Fixed implicit-function-declaration warning for strncasecmp
authorGeorge Nash <george.nash@intel.com>
Thu, 8 Sep 2016 00:28:48 +0000 (17:28 -0700)
committerRick Bell <richard.s.bell@intel.com>
Fri, 9 Sep 2016 16:40:35 +0000 (16:40 +0000)
Both csdk/security/src/aclresource.c and
csdk/security/src/pstatresource.c reports that there is an
implicit declaration of function 'strncasecmp' this means
the code does not see the 'strncasecmp' function from the
header.

The 'strncasecmp function exist in the strings.h header or
in string.h header. To have the funtion in the string.h
header the _GNU_SOURCE or _DEFAULT_SOURCE macro must be
defined.

Since aclresource.c explicity excludes strings.h if string.h
is found the _GNU_SOURCE macro was added.

The _GNU_SOURCE macro was used over the _DEFAULT_SOURCE
macro since there already apears to be a presidence for
the _GNU_SOURCE macro elsewhere in the code.

Change-Id: I2d29521d0f28811be2a58349a5bc8be39b17d76e
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/11529
Reviewed-by: Larry Sachs <larry.j.sachs@intel.com>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
Tested-by: Rick Bell <richard.s.bell@intel.com>
resource/csdk/security/SConscript

index 2e5e55e..4d72175 100644 (file)
@@ -59,7 +59,7 @@ libocsrm_env.PrependUnique(CPPPATH = [
                ])
 
 if target_os not in ['arduino', 'windows']:
-       libocsrm_env.AppendUnique(CPPDEFINES  = ['WITH_POSIX'])
+       libocsrm_env.AppendUnique(CPPDEFINES  = ['WITH_POSIX', '_GNU_SOURCE'])
        libocsrm_env.AppendUnique(CFLAGS = ['-std=c99', '-Wall'])
 
 libocsrm_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])