|
From: | Christian JULLIEN |
Subject: | [Tinycc-devel] RE :Re: [PATCH] Don't break compilation process with unknow option |
Date: | Wed, 7 Jan 2015 08:56:39 +0100 (CET) |
----- message d'origine -----
De : "Michael Matz" <address@hidden>
date mer. 07/01/2015 07:09 (GMT +01:00)
À : "address@hidden" <address@hidden>
Objet : Re: [Tinycc-devel] [PATCH] Don't break compilation process with unknow option
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
[Prev in Thread] | Current Thread | [Next in Thread] |