Q: Dangerous warning.

Alexandre Oliva oliva@dcc.unicamp.br
Mon Jan 25 01:16:00 GMT 1999

On Jan 23, 1999, Sergei Organov <osv@javad.ru> wrote:

> As you see compiler generates (apparently wrong) assignment operator
> and then warns me. So the questions are:

> 1. Is this egcs bug or C++ Standard requirement?

The Standard requires a diagnostic because your program is
ill-formed.  A warning message is a valid diagnostic, so egcs is not
buggy.  The Standard does not state in any way that a compiler is
responsible for generating a volatile version of the assignment
operator; you must do it yourself.

> 2. Can I safely ignore the warning (i.e. does egcs still consider
>    access to 'va' variable as volatile)?


Alexandre Oliva  http://www.dcc.unicamp.br/~oliva  aoliva@{acm.org}
Universidade Estadual de Campinas, SP, Brasil

More information about the Gcc-bugs mailing list