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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2018-09-16
                 CC|                            |manu at gcc dot gnu.org
            Summary|warn about pointer          |warn about pointer
                   |arithmetic in sizeof        |arithmetic in sizeof
                   |                            |(Wsizeof-array-decay)
     Ever confirmed|0                           |1

--- Comment #1 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
Testcase:

int foo(void){
char a[]="blabla";
return sizeof(a-1);
}

Clang:

<source>:4:16: warning: sizeof on pointer operation will return size of 'char
*' instead of 'char [7]' [-Wsizeof-array-decay]
return sizeof(a-1);
              ~^

Reply via email to