Răsfoiți Sursa

Fix Intel compiler warnings on Windows in cmtar

This commit disables or fixes some warnings in the 'cmtar' utility
produced by the Intel compiler on Windows.
Brad King 16 ani în urmă
părinte
comite
1bce13e2b3

+ 1 - 6
Utilities/cmtar/compat/fnmatch.c

@@ -174,12 +174,7 @@ fnmatch(pattern, string, flags)
   /* NOTREACHED */
 }
 
-static int
-rangematch(pattern, test, flags, newp)
-  const char *pattern;
-  char test;
-  int flags;
-  char **newp;
+static int rangematch(const char *pattern, char test, int flags, char **newp)
 {
   int negate, ok;
   char c, c2;

+ 4 - 0
Utilities/cmtar/compat/snprintf.c

@@ -42,6 +42,10 @@
 
 #include <libtar/config.h>
 
+#if defined(__INTEL_COMPILER)
+# pragma warning disable 177 /* function declared but not referenced */
+#endif
+
 #if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF)
 
 #include <stdio.h>

+ 2 - 2
Utilities/cmtar/libtar.c

@@ -312,7 +312,7 @@ extract(char *tarfile, char *rootdir)
   return 0;
 }
 
-
+#if !defined(_WIN32) || defined(__CYGWIN__)
 static void
 usage()
 {
@@ -322,7 +322,7 @@ usage()
          progname);
   exit(-1);
 }
-
+#endif
 
 #define MODE_LIST  1
 #define MODE_CREATE  2