This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC warnings for unused global variables
>>>>> "Joe" == Joe Buck <jbuck@synopsys.com> writes:
Joe> On Fri, May 09, 2003 at 10:29:39AM +0200, Gabriel Dos Reis
Joe> wrote:
>> Telling users that something has no well-defined semantics is part
>> of educating users about what is practically portable. It is not
>> frightening them.
Joe> Gaby, I disagree. You *are* likely to frighten users.
Absolutely.
Speaking as a user -- an implementer of embedded systems, which use
"volatile" for device drivers, for SMP, and for multi-threaded code in
general, I was thoroughly shocked by the claim that "volatile" cannot
be used to write reliable code. That statement had no connection
whatsoever with any of my experience of 15 years of embedded C
programming.
I interpreted it as a warning that gcc may make drastic changes in its
implementation of "volatile" (for example, optimizing away references
on the grounds that the compiler believes it knows they have no side
effects) in the future -- and that any complaints would be answered by
"you've been warned". Such a notion is completely unacceptable.
If that's not the message you intended to convey, I believe a
clarification is called for, because yes indeed, you did frighten
users.
paul