This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug other/44574] Avoid use of atoi


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44574

--- Comment #2 from Joseph S. Myers <jsm28 at gcc dot gnu.org> 2011-05-12 21:08:14 UTC ---
There are also uses of atol, atoll and atoq to eliminate.  Also note some Ada
code using atoi (surely there must be a more idiomatic Ada way of doing this?).
 It would be best to poison all these functions when the uses are eliminated. 
In some cases the use of atoi may be allowing a wider range of inputs (in terms
of leading whitespace and trailing unrecognized characters) than should
actually be allowed in the context.

libiberty has a use of atoi in cplus-dem.c that is harmless (it's only used on
a single-digit string) but pointless (C guarantees that the digit characters
have consecutive integer values so you can just subtract '0', and this
guarantee is already in C90).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]