Re: Compilers should have an option to ignore unknown flags?



In article <1149692211.400998.198530@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
vanospam@xxxxxxx writes:

Dave (from the UK) wrote:
I'm sure I'm not the first or last to try to compile a bit of
open-source software with a Sun compiler and find it stop because some
idiot developer has added -Wall or some other gcc specific flag and
totally ignores what you set CFLAGS too.

I've reported this as a bug on the GNU Common Lisp

http://savannah.gnu.org/bugs/index.php?func=detailitem&item_id=16697

where I set CFLAGS to -fast -fsimple=1, but the the configure script
turns that into


-fast -fsimple=1 -Wall -DVOL=volatile -fsigned-char -O3 -fomit-frame-pointer

So needless to say the Sun compiler (Studio 11) stops.


I'm not suggesting Sun try to implement all gcc flags (that would be
crazy), but it would be useful if there was an option something like

-ignoreunknown

While I understand where you are coming from in porting code from one
os to another, having the compiler or any application for that matter
ask to ignore flags is wrong. While there may be a couple, I can't
think of any application right now that will ignore an incorect option
on the command line. I wouldn't want it to. If it did, then something
that I was sure that I was setting might not be set because of a typo.
For compiler, the results could lead to a long troubleshooting session.
Not my idea of fun.

Better to take the makefiles or make scripts into an editor and resolve
the problems. A few global replaces and they should be eliminated.

As I said before, I understand where you are coming from, but an
-ignoreunkown flag is a bad idea.

I agree that ignoring unknown flags silently would almost always be very
unwise, but as long as it issued a warning message showing the ignored
flag (but didn't fail), would it still be a problem? That way, at least
one would be _told_ which flags had no effect and were accepted for
command-line compatibility only.


--
mailto:rlhamil@xxxxxxxxx http://www.smart.net/~rlhamil

Lasik/PRK theme music:
"In the Hall of the Mountain King", from "Peer Gynt"
.



Relevant Pages

  • Re: cdrecord and large files.
    ... Which has a few "wartze" btw Studio 12 considers flags like ... The Sun compiler guys already know that this incompatible change in cc was a big ... constantly change interfaces. ...
    (comp.unix.solaris)
  • Re: Inserting variables into a Makefile using Autotools.
    ... as flags when compiling at the lower levels. ... abuse the autotools and set CFLAGS in Makefile.am ...
    (comp.os.linux.development.apps)
  • Re: Compilers should have an option to ignore unknown flags?
    ... totally ignores what you set CFLAGS too. ... So needless to say the Sun compiler stops. ... I'm not suggesting Sun try to implement all gcc flags (that would be ... -ignoreunkown flag is a bad idea. ...
    (comp.unix.solaris)
  • Compilers should have an option to ignore unknown flags?
    ... I'm sure I'm not the first or last to try to compile a bit of open-source software with a Sun compiler and find it stop because some idiot developer has added -Wall or some other gcc specific flag and totally ignores what you set CFLAGS too. ... Dave K MCSE. ...
    (comp.unix.solaris)