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

Re: constant/macro confusion on header pages

To: yyyyyyyyyyyyyy@xxxxxxxxxxxxx
Subject: Re: constant/macro confusion on header pages
From: Larry Dwyer <yyyyyyyyyyy@xxxxxx>
Date: Mon, 17 Apr 2006 18:14:13 -0700
References: <1144687808.29875.67.camel@xxxxxx><20060410142529.GA21592@xxxxxx><1144687808.29875.67.camel@xxxxxx>
Why should we preclude the use of enumerated constants, which are symbolic and are constants?

I, for one, have a real problem explaining to engineers why they can't use an enumerated constant to implement *any* of the symbolic constants defined in the standard. After all, enumerated constants have the benefit of type checking, which macro constants do not. For this reason, engineers consistently choose enumerated constants when implementing new functions and they are consistently hitting the test failures in the conformance tests.

Cheers,
Larry

At 02:26 AM 4/11/2006, Geoff Clare wrote:
Andrew Josey <yyyyyy@xxxxxxxxxxxxxxxxx> wrote, on 10 Apr 2006:
>
> We have some wording in XRAT A.1.4 about the overlap of terms "macro",
> "symbolic name" and "symbolic constant". Do we need to include constant
> in there too.

I think we should not use plain "constant", to avoid confusion.
The places where it is used should be changed to "symbolic constant",
and we should add a definition of "symbolic constant" in normative
text.  Possible things to include in the definition are:

    - it is a macro
    - it expands to some type of constant expression (possibly a
      pre-processor constant, i.e. usable in #if)
    - it has type int unless otherwise specified
    - the value is protected with parentheses when necessary

> Of course we could also bite the bullet and try and fix these terms in
> the revision

We should probably try to use "symbolic constant" wherever possible,
and only use other wording when the requirements in the definition
of symbolic constant are not appropriate.  (E.g. if we decide that
symbolic constants should be usable in #if, then there will be
some exceptions.)  As part of this activity we should ensure we have
captured any requirements from the C Standard, such as those for
errno values that Paul Eggert pointed out.

--
Geoff Clare <yyyyyyy@xxxxxxxxxxxxx>
The Open Group, Thames Tower, Station Road, Reading, RG1 1LX, England
end
reply-id: wf2dkwirn4nwifn834dt7zyrqpmfdyyxdrhnwowe


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