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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Drea Pinski <pinskia at gcc dot gnu.org> ---
From:
https://gcc.gnu.org/onlinedocs/gcc-16.2.0/gcc/Common-Attributes.html#index-const
```
The const attribute prohibits a function from reading objects that affect its
return value between successive invocations. However, functions declared with
the attribute can safely read objects that do not change their return value,
such as non-volatile constants.
```


So your code is undefined.  You want pure attribute instead.

Reply via email to