Subject: Re: mklocale, take 2
To: None <>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-toolchain
Date: 10/22/2001 08:55:23
>>> (NB: i'm just recycling RMS' arguemnt from the early 90s.)
>> What RMS never noticed - or at least never seemed to notice - is
>> that exactly the same argument applies to __attribute__.  Or any
>> other nonstandard extension.

> No, he never said that.  What he did say, and it's in the gcc manual is:

>    Some people object to the `__attribute__' feature, suggesting that
>   ANSI C's `#pragma' should be used instead.  There are two reasons for
>   not doing this.
>   1. It is impossible to generate `#pragma' commands from a macro.
>   2. There is no telling what the same `#pragma' might mean in another
>      compiler.

(2) is the argument that was being "recycled" ((1) is certainly valid,
even to the tech-toolchain discussion, but wasn't mentioned in this
connection), and it applies just as strongly to __attribute__.

Since it also applies to __attribute__, it is not a reason for
preferring it to #pragma (which makes it bogus in the context presented
in the gcc manual, and as I recall also in the tech-toolchain thread).

There is, it occurs to me, another reason: unrecognized #pragmas are to
be ignored (I think), whereas a compiler that doesn't recognize
__attribute__ at all will treat it as a syntax error.  (Of course,
whether this is good or bad depends on whether the attribute you want
to declare should be ignored if not present.  Struct packing, as the
discussion has pointed out, shouldn't be ignored.)

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B