[m-rev.] diff: do not pass -ansi to GCC on any system

Julien Fischer jfischer at opturion.com
Tue Sep 23 17:21:50 AEST 2014


On Tue, 23 Sep 2014, Peter Wang wrote:

> On Tue, 23 Sep 2014 15:51:48 +1000 (EST), Julien Fischer <jfischer at opturion.com> wrote:
>>
>> Do not pass -ansi to GCC on any system.
>>
>> Passing -ansi to GCC restricts us to the C90 dialect of C and prevents us from
>> using C99 library features with GCC.  Since every version of GCC we support
>> provides the relevant C99 features there is not much point to imposing this
>> restriction.  As already noted in the configure script the use of -ansi was
>> also causing problems with the header files on MinGW systems.  Finally, I do
>> think it is reasonable to require users to use the C90 dialect of C in
>> foreign_proc and foreign_code pragma bodies by default.
>
> Do or do not?

Do not.

>> NOTE: this is *not* an invitation to start using C99 language features
>> throughout the runtime and library -- at this point, we (unfortunately) still
>> maintain compatibility with older versions of MSVC that don't support these
>> features.
>>
>> configure.ac:
>>  	Do not pass -ansi to GCC.  Add an explanation of why.
>>
>> scripts/mgnuc.in:
>>  	Update the description of the what the --no-ansi option does.
>>  	(XXX there's _a lot_ of out-of-date stuff in this script.)
>
> So after this change, mmc --ansi-c is still the default but actually
> does nothing with any compiler,

Yes, although it is hasn't done anything with C compilers other than GCC
for a while now.

> and mgnuc --ansi is the default but it
> doesn't pass -ansi anywhere, but does pass -D__EXTENSIONS__ -D_GNU_SOURCE?

The latter behaviour was what prompted my XXX comment, since I'm pretty
sure mmc --make, for example, doesn't replicate that behaviour.  Also,
why define _GNU_SOURCE on systems that do not use the GNU C library?

> I assume this is an interim step.  I would like to see --ansi-c and
> --ansi removed, but treated as a no-op indefinitely for backwards
> compatibility.

I have no objections to removing them.  They haven't done anything
useful for many years now.

Cheers,
Julien.



More information about the reviews mailing list