Fixed implicit-function-declaration warning for strnlen function
authorGeorge Nash <george.nash@intel.com>
Wed, 7 Sep 2016 22:19:10 +0000 (15:19 -0700)
committerRick Bell <richard.s.bell@intel.com>
Fri, 9 Sep 2016 16:39:41 +0000 (16:39 +0000)
The strnlen is a GNU extension and not a standard C function and
is not avalible unless the macro _DEFAULT_SOURCE or _GNU_SOURCE is
defined.

It looks like _GNU_SOURCE already has a precidence so it was added
to the build script.

Change-Id: Ied150e5b97a965c1b4b240d364e49669bdad4f11
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/11523
Reviewed-by: Larry Sachs <larry.j.sachs@intel.com>
Reviewed-by: David Antler <david.a.antler@intel.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
resource/csdk/SConscript

index a1747ed..6893732 100644 (file)
@@ -69,7 +69,7 @@ if 'BROKER' in with_mq:
        liboctbstack_env.AppendUnique(CPPDEFINES = ['MQ_BROKER', 'WITH_MQ'])
 
 if target_os not in ['arduino', 'windows']:
-       liboctbstack_env.AppendUnique(CPPDEFINES  = ['WITH_POSIX'])
+       liboctbstack_env.AppendUnique(CPPDEFINES  = ['WITH_POSIX', '_GNU_SOURCE'])
        liboctbstack_env.AppendUnique(CFLAGS = ['-std=c99'])
 
 if liboctbstack_env.get('ROUTING') == 'GW':