]> granicus.if.org Git - graphviz/commitdiff
remove recapitulated prototypes of strcasecmp
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 11 Feb 2021 15:34:43 +0000 (07:34 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 17 Feb 2021 01:12:32 +0000 (17:12 -0800)
These actually cause warnings in CMake Windows builds:

  …\lib\cgraph/strcasecmp.h(15,47): warning C4273: '_stricmp': inconsistent
    dll linkage […\graphviz\build\plugin\gd\gvplugin_gd.vcxproj]
  C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\string.h(193,22):
    message : see previous definition of '_stricmp'
    […\build\plugin\gd\gvplugin_gd.vcxproj]

and MSBuild Windows builds:

  …\lib\cgraph\strcasecmp.h(23,64): warning C4211: nonstandard extension used:
    redefined extern to static […\graphviz\lib\cgraph\cgraph.vcxproj]
  …\lib\cgraph\strcasecmp.h(27,75): warning C4211: nonstandard extension used:
    redefined extern to static […\lib\cgraph\cgraph.vcxproj]

and Cygwin MinGW builds:

  …/lib/cgraph/strcasecmp.h:15:5: warning: '_stricmp' redeclared without
    dllimport attribute: previous dllimport ignored [-Wattributes]
     15 | int strcasecmp(const char *s1, const char *s2);
        |     ^~~~~~~~~~
  …/lib/cgraph/strcasecmp.h:16:5: warning: '_strnicmp' redeclared without
    dllimport attribute: previous dllimport ignored [-Wattributes]
     16 | int strncasecmp(const char *s1, const char *s2, size_t n);
        |     ^~~~~~~~~~~

Related to #1940.

lib/cgraph/strcasecmp.h

index e2ec198c90447ec2ce4e5049ce80ee4c0dbcfadd..78654feb7edc05934a3cdad99f85b6407c983893 100644 (file)
@@ -4,17 +4,6 @@
 
 #include <stddef.h>
 
-/* Re-prototype the functions we are abstracting. The purpose of this is to
- * cause a compiler warning if our implementations diverge. Windows compilation
- * will see these and the inline functions below, and warn if they do not match.
- * Compilation on other platforms will see these and the strings.h prototypes,
- * and warn if they do not match. This way we have a safeguard that the
- * alternatives provided for Windows match the libc functions on other
- * platforms.
- */
-int strcasecmp(const char *s1, const char *s2);
-int strncasecmp(const char *s1, const char *s2, size_t n);
-
 #ifdef _MSC_VER
   /* redirect these to the Windows alternatives */