|
From: mij <mi...@ss...> - 2015-03-27 09:43:28
|
When running portability-related assessments, avoid “man” as the pest.
“man” is the most implementation-specific source of information you can find.
Run “man” on two different systems, get two different descriptions.
SSHGuard was written against POSIX, and that’s what enabled it to run on
such wide range of servers. Let’s try to maintain it at that level. Use the POSIX
reference from the OpenGroup.
cheers
michele
> On 26 Mar 2015, at 23:31, James Harris <jam...@gm...> wrote:
>
>
> 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...
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming The Go Parallel Website, sponsored
> by Intel and developed in partnership with Slashdot Media, is your hub for all
> things parallel software development, from weekly thought leadership blogs to
> news, videos, case studies, tutorials and more. Take a look and join the
> conversation now. http://goparallel.sourceforge.net/_______________________________________________
> Sshguard-users mailing list
> Ssh...@li...
> https://lists.sourceforge.net/lists/listinfo/sshguard-users
|