On Mar 5, 12:54 pm, Juha Nieminen <nos...@thanks.invalid> wrote:
> James Kanze wrote:
> > -- The storage specifier (static, extern, etc.) is always
> > first. (I think C99 even deprecates putting it elsewere.)
> > -- Direct type modifiers (like long or unsigned) always precede
> > the base type, if the base type is present, and the
> > signedness modifier precedes the size modifier. In other
> > words: "long int" instead of "int long", and "unsigned char"
> > instead of "char unsigned". Also, no other elements are
> > interposed---I've never seen anything like "long const int",
> > for example.
> What about things like volatile and mutable?
Don't use them

. Seriously, volatile is a cv-qualifier, and
everywhere I've seen it used, it has followed the rules of
const. Mutable is a bit special (in my mind, at least); I tend
to think of it almost like a storage class, and put it at the
start, but arguably, it is closer to a cv-qualifier. (The big
difference, of course, is that it can only be used in the
declaration specifier, to apply to the declared object---you
don't have e.g. mutable qualified lvalues, or pointers to
mutable.)
And of course, none of these would ever be put between int and
long, or long and unsigned. (At least, I've never seen anyone
who would do that in real code.) But something like "int
mutable long" is perfectly legal.
--
James Kanze (GABI Software) email:
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34