This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/13609] sscanf optimization error
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Jan 2004 22:25:24 -0000
- Subject: [Bug optimization/13609] sscanf optimization error
- References: <20040107220146.13609.BStrauss-gcc@feliscatus.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-01-07 22:25 -------
Not a bug %[a-z] expects a char array and you are only supplying it with enough room for zero
characters.
>From the man of printf:
[ Matches a nonempty sequence of characters from the specified set of accepted
characters; the next pointer must be a pointer
to char, and there must be enough room for all the characters in the string, plus a
terminating NUL character. The usual
skip of leading white space is suppressed. The string is to be made up of characters in
(or not in) a particular set; the
set is defined by the characters between the open bracket [ character and a close
bracket ] character. The set excludes
those characters if the first character after the open bracket is a circumflex ^. To include
a close bracket in the set,
make it the first character after the open bracket or the circumflex; any other position
will end the set. The hyphen char-
acter - is also special; when placed between two other characters, it adds all intervening
characters to the set. To include
a hyphen, make it the last character before the final close bracket. For instance,
`[^]0-9-]' means the set `everything
except close bracket, zero through nine, and hyphen'. The string ends with the
appearance of a character not in the (or,
with a circumflex, in) set or when the field width runs out.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13609