[RFA:] more glibc fixinclude adjustments for extern inline

Hans-Peter Nilsson hans-peter.nilsson@axis.com
Mon Dec 17 14:06:00 GMT 2007

> Date: Sun, 16 Dec 2007 20:20:05 -0800
> From: Bruce Korb <bkorb@gnu.org>

> Hans-Peter Nilsson wrote:
> > What's the purpose of the second c_fix_arg?  By the effect it
> > appears to work as an alternative "select" line; *all*
> > occurrences of "(^|)extern " (not just those preceding "extern
> > __inline") will be replaced by the first c_fix_arg wrapping.  No
> > badness is expected to be caused by it, it was just a bit
> > confusing.  The posting of that patch doesn't make it clear it
> > was intended, though the ChangeLog explicitly mentions the
> > second c_fix_arg.
> The intent was to keep hands off of _extern.

My question was more about the *two* c_fix_arg's, not really the
"(^|)extern " regexp.  If it's only to avoid matching _extern,
it sounds like glibc_c99_inline_4 should look like this:

fix = {
    hackname  = glibc_c99_inline_4;
    files     = sys/sysmacros.h, '*/sys/sysmacros.h';
    bypass    = "__STDC_VERSION__";
    select    = "(^| )extern __inline";
    c_fix     = format;
    c_fix_arg = "\n#ifdef __GNUC_GNU_INLINE__\nextern\n#endif\n__inline";
    test_text = <<-EOT
	__extension__ extern __inline unsigned int
	__extension__ __extern_inline unsigned int
	extern __inline unsigned int

(Alternatively, replacing with "__extension __extern_inline".
Possibly an "_extern __inline int" should also be added to the

> Despite the "glibc" in the name, these will examine all wchar.h and
> all features.h files on all systems.  How sure are you that
> "extern __inline" won't be found on other systems?

About as sure as with the other glibc_c99_inline_*, not the
least glibc_c99_inline_4! :)  And if there are any, I'm certain
they should be fixincluded.

> How about "__extern __inline"?  You'll get interesting results
> if that ever pops up.

Yeah, like an error message, unless there's a matching
#define __extern or something. ;)

>  If you've thought of these things and are
> pretty confident, then it is fine for top of tree.

I'll codify the confidence and change the
 select    = "extern __inline";
 select    = "(^| )extern __inline";
(the c_fix_arg already adds a newline as first char) and commit.


brgds, H-P

More information about the Gcc-patches mailing list