This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: Irritating warnings about implicit functions
- From: "Andy Falanga (afalanga)" <afalanga at micron dot com>
- To: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Cc: GCC-help <gcc-help at gcc dot gnu dot org>
- Date: Mon, 26 Aug 2013 16:58:22 +0000
- Subject: RE: Irritating warnings about implicit functions
- Authentication-results: sourceware.org; auth=none
- References: <60F6FAE47D1BCE4380CC06D18F49789B4FB27F40 at NTXBOIMBX02 dot micron dot com> <CAH6eHdTa9=JOqmQ-y1O-Mx2uXd=P1G84HBTHd5oHFOzJgznDgw at mail dot gmail dot com>
>
> You forgot to include example code that demonstrates the problem.
Trying to make a small, reproducible case forced me to take a different path which led to the solution. The solution I was trying was to place the define for _GNU_SOURCE in a "master" header file which is used by all others. I was apparently missing an include which happened earlier on and prevented definition at the point I'd placed it from taking hold. The solution appears to be what I found in the feature_test_macros(7) man page: placing the #define _GNU_SOURCE in the *.c file *before any* includes. This prevents the irritating warnings even when compiling with -std=c99 (as it should).
Just out of curiosity, could you explain why, even with the functions popen(), pclose() and syscall() being in the code sent to the compiler, the compiler would complain that they were implicitly defined?
Thanks,
Andy