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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2008-09-13 12:37:20         |2021-9-28

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So this is interesting.
Since GCC 11, the C front-end warns if the struct is volatile:
<source>: In function 'getfoo':
<source>:9:23: warning: comparison is always true due to limited range of data
type [-Wtype-limits]
    9 |         while (bits.a < 3)
      |                       ^

But not if it is not volatile.
Also the C++ front-end does not warn in either case.

Reply via email to