tech-toolchain archive

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

Re: -std=gnu99



On Wed, 21 May 2014, David Holland wrote:

> On Tue, May 20, 2014 at 07:00:11PM +0100, Iain Hibbert wrote:
>  > > On Fri, May 16, 2014 at 09:10:12PM +0100, Iain Hibbert wrote:
>  > >> I mean to change bsd.sys.mk to always provide -std=gnu99 in CFLAGS as 
> per
>  > >> below patch, as if the code base requires gnu99 then it will require it
>  > >> whichever compiler is in use.
>  > >
>  > > ...why break the build system so as to pass a gcc (and clang) option
>  > > to potentially arbitrary other compilers that won't understand it?
>  >
>  > which other compilers?
>
> Well, there's pcc, but I suppose if it didn't understand this option
> ragge would have said so upthread.

Well, I specifically mentioned PCC in my last message as supporting this
option..

> However, what I meant was: any others we might want to try or tinker
> with.

..so my question remains, which other compilers?

> All you're doing is increasing the amount of effort it takes to
> try a different compiler.

Not really. I have been trying a different compiler (PCC) and the *lack*
of -std=gnu99 has made it more difficult.  In fact, I would probably have
picked up on it earlier, but it turned out that currently unless you
specifically disable all other compiler support you get -std=gnu99 added,
which is the bug I am wanting to fix.

> By all means fix the conditional to test the right thing, and add pcc to
> it if appropriate. But there's no benefit to *removing* the conditional.

I maintain that there is, for the moment. The *source code* is C99 with
some GNU dialect features. This means that this is not conditional, as no
compiler will be able to build it correctly without GCC compat active.

>  > > AIUI it should be conditionalized on ACTIVE_CC, but it should still be
>  > > conditionalized.
>  >
>  > Except for the fact that if it were to be conditional, then yes it should
>  > be using ACTIVE_CC (which is a different WTF itself), I don't agree. The
>  > sources are currently too dependent on GNU C, and you just can't build
>  > NetBSD without GCC compat active.
>
> That's a bug. Don't add to it / make it worse.

and as I said, that is not a bug I am prepared to tackle at this time.
In fact, I am not sure that some of it is worthwhile to remove it since
we use features that are not available in standard C99. In any case, when
another compiler can be used to build the base system properly (I am not
convinced that this is possible**, currently) then we can revisit this.

regards,
iain

** 
http://nxr.netbsd.org/source/search?q=UNSUPPORTED_COMPILER&project=src&defs=&refs=&path=&hist=


Home | Main Index | Thread Index | Old Index