[Bug c/69480] Bad error message on assigning to read-only

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jan 26 04:13:00 GMT 2016


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2016-01-26
     Ever confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed, the C++ front-end is much better though the location is not so good.

t6.c: In function ‘fail’:
t6.c:13:28: error: assignment of read-only location
‘*__builtin_memcpy(&<U1b90>, &({...}))’
         ACCESS_ONCE(*s->p) = p;
                            ^

apinski@arm64:~/src/local/gcc/objdir/gcc$ g++ t6.c
t6.c: In function ‘void fail(fail*, uint32_t)’:
t6.c:13:30: error: assignment of read-only location ‘*({...})’
         ACCESS_ONCE(*s->p) = p;
                              ^


More information about the Gcc-bugs mailing list