[Bug libgcc/67154] sscanf does not extract correct value when the format is "%c" and the location is of type int*

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Aug 8 02:42:00 GMT 2015


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

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

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Not a bug.  Scanf with %c writes to a char pointer so if you look at the
correct byte of the integer (big and little endian targets would cause a
difference) you will see it places the correct value there and left the other
bytes as what they were before calling scanf. 


If you had compiled with -W -Wall you would have seen a warning about this.



More information about the Gcc-bugs mailing list