瀏覽代碼

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 年之前
父節點
當前提交
1bce13e2b3
共有 3 個文件被更改,包括 7 次插入8 次删除
  1. 1 6
      Utilities/cmtar/compat/fnmatch.c
  2. 4 0
      Utilities/cmtar/compat/snprintf.c
  3. 2 2
      Utilities/cmtar/libtar.c

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

@@ -174,12 +174,7 @@ fnmatch(pattern, string, flags)
   /* NOTREACHED */
   /* 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;
   int negate, ok;
   char c, c2;
   char c, c2;

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

@@ -42,6 +42,10 @@
 
 
 #include <libtar/config.h>
 #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)
 #if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF)
 
 
 #include <stdio.h>
 #include <stdio.h>

+ 2 - 2
Utilities/cmtar/libtar.c

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