[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: mig stubs need _GNU_SOURCE



Roland McGrath <frob@debian.org> writes:

> > Could you make mig prepend #define _GNU_SOURCE to its output files?
> 
> We could, and there isn't much reason not to.  But still, please show us
> the actual problems first.

In Info: (libc)Feature Test Macros:

:    You should define these macros by using `#define' preprocessor
: directives at the top of your source code files.  These directives
: _must_ come before any `#include' of a system header file.  It is best
: to make them the very first thing in the file, preceded only by
: comments.  You could also use the `-D' option to GCC, but it's better
: if you make the source files indicate their own meaning in a
: self-contained way.

I presume that applies to computer-generated sources as well.

My other source files contain the #define _GNU_SOURCE directive,
so the Makefile.am didn't have to care of that before I added the
mig-generated file.  Automake doesn't seem to offer a way to
specify CPPFLAGS for a single file.  I tried adding -D_GNU_SOURCE
to the main CPPFLAGS but that led to annoying warnings about
redefining the macro.  (Perhaps I should have used
-D_GNU_SOURCE= instead.)


Reply to: