This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] testsuite: stdlib/isomac.c: add missing include
- From: Jonathan Nieder <jrnieder at gmail dot com>
- To: Aurelien Jarno <aurelien at aurel32 dot net>
- Cc: libc-alpha at sourceware dot org
- Date: Tue, 8 Jan 2019 15:35:54 -0800
- Subject: Re: [PATCH] testsuite: stdlib/isomac.c: add missing include
- References: <20190108201038.20996-1-aurelien@aurel32.net>
Aurelien Jarno wrote:
> When running the testsuite, building stdlib/isomac.c outputs the
> following warning:
>
> gcc -O -D_GNU_SOURCE -DIS_IN_build -include /home/aurel32/glibc-build/config.h isomac.c -o /home/aurel32/glibc-build/stdlib/isomac
> isomac.c: In function ‘get_null_defines’:
> isomac.c:260:3: warning: implicit declaration of function ‘close’; did you mean ‘pclose’? [-Wimplicit-function-declaration]
> close (fd);
> ^~~~~
> pclose
>
> Fix that by adding the <unistd.h> include.
>
> Changelog:
> * stdlib/isomac.c: Include <unistd.h>.
> ---
> ChangeLog | 4 ++++
> stdlib/isomac.c | 1 +
> 2 files changed, 5 insertions(+)
Indeed, in POSIX close() requires unistd.h[*].
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
[*] pubs.opengroup.org/onlinepubs/9699919799/functions/close.html