tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] [PATCH] Don't break compilation process with unknow o


From: Sergey Korshunoff
Subject: Re: [Tinycc-devel] [PATCH] Don't break compilation process with unknow option
Date: Wed, 7 Jan 2015 13:22:46 +0300

I'm agree. But what to do with the described bug? How to fix it?

cd tcc-source
./configure --cc=tcc; make; make install; make test
tcc -o tcctest.cc tcctest.c -I.. -I..  -w  -DTCC_TARGET_I386
-std=gnu99 -O0 -fno-omit-frame-pointer
tcc: error: invalid option -- '-std=gnu99'


2015-01-07 9:08 GMT+03:00, Michael Matz <address@hidden>:
> Am 07.01.2015 um 04:14 schrieb Sergey Korshunoff:
>>
>> After applying a "disable DTEST" patch to allow "make test"  to pass a
>> broken tests...
>>     ./configure --cc=tcc; make; make install; make test
>> tcc -o tcctest.cc tcctest.c -I.. -I..  -w  -DTCC_TARGET_I386
>> -std=gnu99 -O0 -fno-omit-frame-pointer
>> tcc: error: invalid option -- '-std=gnu99'
>>
>> With a patch apllied a test can be performed with
>>     make CFLAGS=-Wunsuported test
>>
>> And your solution?
>
> The makefile (and/or configure) needs to be fixed to not hardcode
> potentially unknown compiler options.
>
>> What you will add to CFLAGS?
>
> Nothing.  The only sensible thing that tcc can to with completely
> unknown options is to error out on them.  It can't simply ignore them,
> not even with a warning as the unknown option in question might have
> significant effects for code generation for a compiler understanding it
> (-std=gnu99 is on the border of being such option) and the author might
> _require_ that effect to happen for his compilations.  Ignoring it would
> either generate unnecessary followup errors or silently generate code
> with the wrong semantics, which is worse.
>
> There is a case to be made to only warn for unknown options that
> influence diagnostics only.  As it's unknown it's of course hard to know
> when exactly that is the case.  If it starts with -W that might be a
> good enough heuristic in practice, so I'm with Thomas on this topic.
>
> If you absolutely hate fixing makefiles/configures for trying out tcc,
> instead of patching tcc to ignore all unkown options you could also
> simply write a wrapper script that removes _known_ unknown options that
> you happen to hit when you know they indeed aren't important.
>
>
> Ciao,
> Michael.
>
> _______________________________________________
> Tinycc-devel mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
>



reply via email to

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