Parcourir la source

[master] Workaround for unused-variable issues on Solaris.

Marcin Siodelski il y a 13 ans
Parent
commit
39dcfd79bb
1 fichiers modifiés avec 8 ajouts et 0 suppressions
  1. 8 0
      tests/tools/perfdhcp/perfdhcp.cc

+ 8 - 0
tests/tools/perfdhcp/perfdhcp.cc

@@ -31,6 +31,14 @@
 int
 main(const int argc, char* const argv[])
 {
+    // We need to manipulate argc and argv to avoid
+    // unused-variable warnings.
+    // This is temporary solution.
+    int ac = argc;
+    char* av = argv[0];
+    if (ac >= 0 && av != 0) {
+        ac = 1;
+    }
     fprintf(stderr, "perfdhcp is not supported on this version of the operating system\n");
     return (1);
 }