This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: order of -D and -U is significant


Vincent Lefevre wrote:
> On 2009-08-05 10:07:49 +0100, Dave Korn wrote:
>>   GCC does not install an executable called "c99". Or one called
>> "c89". So what any standard requires of them is irrelevant to us,
>> except that we would want to make it possible to support that mode
>> of operation. And we do; with our predictable behaviour, all "c89"
>> has to do is sort the command-line options so all the -Ds come first
>> and all the -Us come last, and then invoke "gcc".
> 
> Recognizing options may depend on the GCC version. Or do GCC developers
> guaranty that no options that can take an argument will be added in the
> future?

  I'm trying hard to think of a case where an option argument might begin with
-U or -D and not succeeding, but I guess it's possible in theory that some
future option might want to take arguments like that (otherwise, there's no
parsing ambiguity).  Users of a hypothetical c89 wrapper script would want to
use the joined form of the switches for those arguments!

  Also, just as an illustration, the libtool project doesn't seem to find
keeping up with the rate of change of GCC options a serious burden, because
almost all the churn is in things like -f and -m that stick to the current
formats, and there are only very rarely entirely new classes of option format added.

>> I'm sure nobody will raise any objection to adding a command-line
>> flag if you want to integrate this behaviour into the driver.
> 
> This would be better.

  Notwithstanding all the above, I agree.  But I also think a wrapper script
/would/ be a practical solution for anyone who wanted it.

    cheers,
      DaveK


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]