This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/57039] -Wsequence-point missing warning for such case


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57039

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |egallager at gcc dot gnu.org
         Resolution|---                         |WORKSFORME

--- Comment #1 from Eric Gallager <egallager at gcc dot gnu.org> ---
I get a -Wsequence-point warning with gcc8:

$ /usr/local/bin/g++ -c -Wall -Wextra -pedantic -Wsequence-point 57039.cc
57039.cc: In function ‘int main(int, char**)’:
57039.cc:5:5: warning: operation on ‘color’ may be undefined [-Wsequence-point]
     ++color = (color > 3) ? 0 : color;
     ^~~~~~~
57039.cc:2:31: warning: unused parameter ‘argv’ [-Wunused-parameter]
 int main(int argc, char* argv[])
                               ^
$

Was probably FIXED, but I don't have the computing resources for bisection, so
I'll just say WORKSFORME.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]