Email List: Xaustin-group-lX
[All Lists]

Re: c99 -I option and GCC

To: austin-group-l@xxxxxxxxxxxxx
Subject: Re: c99 -I option and GCC
From: Vincent Lefevre <vincent-opgr@xxxxxxxxxx>
Date: Wed, 5 Aug 2009 21:30:45 +0200
Mail-followup-to: austin-group-l@opengroup.org
References: <4a76fb43.lbC4QjMxLz0GOnAz%Joerg.Schilling@fokus.fraunhofer.de><200908031526.n73FQ0M7002876@aragorn.savarese.org><20090804003819.GE3746@prunille.vinc17.org><20090804083311.GA29260@squonk.masqnet><20090804115624.GD1239@prunille.vinc17.org><20090805145911.GA7443@squonk.masqnet>
On 2009-08-05 15:59:11 +0100, Geoff Clare wrote:
> The default behaviour when an option that has option-arguments is
> repeated is stated in Syntax Guideline 11:
> 
>     If an option that has option-arguments is repeated, the option and
>     option-argument combinations should [shall for standard utilities]
>     be interpreted in the order specified on the command line.
> 
> In cases where one overrides the other, it would need to be stated
> explicitly in the utility description.

But this is just a default behavior. Because of the rule concerning
-U vs -D, the status of this guideline here is not clear. Even
without that rule. For instance, if you assume that there is no
override, then with -DFOO=1 -DFOO=2, should this be like

#define FOO 1
#define FOO 2

or

#define FOO 2
#define FOO 1

(as the #define are seen as being preprended to the source)?

Even though both forms will yield undefined behavior, the
specification comes first. And if you assume that the spec is not
clear enough to determine the order, one can also assume that it is
not clear enough to determine whether one can consider that -DFOO=2
overrides -DFOO=1, and this is left to the implementation.

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)

<Prev in Thread] Current Thread [Next in Thread>