This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: possible Linux bootstrap problem possible fix



On 02/11/2006, at 12:47 AM, Jakub Jelinek wrote:


On Tue, Oct 31, 2006 at 10:30:27PM -0800, Geoffrey Keating wrote:
Andrew claims that there is a GCC bootstrap problem on Linux because
some parts of GCC build with -std=c99 and the Linux headers are not
compatible with C99.

It is not just about GCC bootstrap, basically everything that compiles in Linux with -std=gnu99 or -std=c99 (many programs) are now broken. And not just because of glibc headers, but dozens of other packages.

Swapping the meaning of 'inline' vs. 'extern inline' certainly isn't
sufficient, I'd add that's the easy part which can be easily fixed
in the headers just by macroizing all current uses of extern inline.

What's far more problematic is the rest of the changes. The more I look
at the ISO C99 inline semantics, the more I like the GNU inline semantics,
which has been designed to accomodate the needs of GNU C library when
it was added to GCC.


In particular, glibc often has a function prototype in a generic
header:

extern void foo (void);

and then, optionally, in some target specific header an inline optimization
for it:


extern inline void foo (void) { whatever; }

but e.g. not all targets provide the inline optimizations or they are
guarded by some complicated preprocessor conditions.
In the ISO C99 inline semantics we'd need to know beforehand if a function
will have an inline optimization or not and depending on that either use
extern or inline keywords on the prototype in the generic header.
I don't know what the ISO C99 inline semantics is supposed to be good for,
but certainly not for this case.

You could just not use any keyword,


void foo(void);

and get the same effect.



Attachment: smime.p7s
Description: S/MIME cryptographic signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]