[Top][All Lists]

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

Re: AC_PROG_CC_* shouldn't append multiple options

From: Adrian Bunk
Subject: Re: AC_PROG_CC_* shouldn't append multiple options
Date: Fri, 21 Sep 2012 12:01:55 +0300
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Sep 20, 2012 at 10:20:35PM -0700, Paul Eggert wrote:
> On 09/20/2012 03:29 PM, Adrian Bunk wrote:
> > ac_cv_prog_cc_c11 is no longer documented (but still set, and should
> > not be removed). Wanting to check that variable might even be a valid 
> > usecase for AC_PROG_CC_C11?
> I'm not sure we should be documenting any of that stuff, but if
> we do, I'd rather document ac_prog_cc_stdc.
> > autoconf now sets the compiler to the last C mode requested, not the 
> > highest requested.
> Yes, the idea is that AC_PROG_CC_C89 puts the compiler into C89 mode,
> which might be useful for part of the 'configure' script I suppose,
> and that you should be able to change it back if you like.  (This
> is kind of what it was trying to do anyway, though not doing a particularly
> good job about it.)
> No doubt this should all be documented better.
> Or perhaps we should just mark AC_PROG_CC_C89 and
> AC_PROG_CC_C99 as obsolete, as they're typically more trouble
> than they're worth.
> > [1] 
> > http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_c99_inline.m4
> Yup, macros that invoke AC_PROG_CC_C89 and AC_PROG_CC_C99
> are trouble.  They're trouble now, and they'll continue to
> be trouble.  It's not clear how to fix this, other than
> to advise people to avoid those macros, which the patch
> does in the manual.

Marking AC_PROG_CC_C89/AC_PROG_CC_C99/AC_PROG_CC_STDC as obsolete
(and turning them into aliases for AC_PROG_CC) is an option, and the 
more I think about it, it seems like the only option where trying to 
set the compiler into the highest possible mode in AC_PROG_CC makes sense.

Code today tends to be C89 with a few C99 features, so there is no 
immediate benefit of C11 mode.

What exactly are the side effects of putting the compiler into the 
highest possible mode?

Recent glibc hides the gets() prototype when the compiler is in C11 
mode, which shouldn't be a huge issue.

Any other changes of C89/C99 behaviour that might affect code in 
packages using autoconf?



       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed

reply via email to

[Prev in Thread] Current Thread [Next in Thread]