|
From: James H. <jam...@gm...> - 2015-03-26 22:31:25
|
I was looking at some of the compiler warnings I get while building trunk.
sshguard_options.c: In function ‘get_options_cmdline’:
sshguard_options.c:148:21: warning: implicit declaration of function
‘setenv’ [-Wimplicit-function-declaration]
setenv("SSHGUARD_EVENT_EXECUTE", optarg, 1);
sshguard_logsuck.c: In function ‘read_from’:
sshguard_logsuck.c:354:13: warning: implicit declaration of function
‘usleep’ [-Wimplicit-function-declaration]
usleep(20 * 1000);
If I remove AM_CFLAGS+= -D_XOPEN_SOURCE from the non Solaris case the
warnings go. Another way to go is set AM_CFLAGS+= -D_XOPEN_SOURCE=600 as
that will also remove the warning. In other words remove the conditional
and the compile completes without issue.
My "man 3 usleep" has
usleep():
Since glibc 2.12:
_BSD_SOURCE ||
(_XOPEN_SOURCE >= 500 ||
_XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED) &&
!(_POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700)
Before glibc 2.12:
_BSD_SOURCE || _XOPEN_SOURCE >= 500 || _XOPEN_SOURCE &&
_XOPEN_SOURCE_EXTENDED
and my "man 3 setenv" has
setenv(), unsetenv():
_BSD_SOURCE || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600
So what do we think is safer ? Remove _XOPEN_SOURCE or add || LINUX to the
solaris conditional?
--
James Harris
Software Engineer
jam...@gm...
|