[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#232430: libc6: strtof is completelly broken, garbage is returned



On Thu, Feb 12, 2004 at 01:41:53PM -0500, Daniel Jacobowitz wrote:
> drow@nevyn:~% gcc -g -o stof stof.c -Wall
> stof.c: In function `main':
> stof.c:7: warning: implicit declaration of function `strtof'
> stof.c:7: warning: double format, different type arg (arg 2)
> 
> Always, always use compiler warnings when looking at a problem like
> this one.
> 
> According to stdlib.h strtof is only available in C99 mode.  If I add
> -std=c99 the program works.  If you add -D_GNU_SOURCE, it probably will
> work then also.
> 
> At most the man page needs a note.  It does already say:
> CONFORMING TO
>        ANSI C describes strtod, C99 describes the other two functions.

I was thinking that the default C mode for gcc was C99, but now i've
discovered that it is really a mix of C90 and C99. This default mode
annoys me... but you are totally right here, this bug should be closed.

Can you believe that two persons were looking with gdb and were doing
some more weird and deeper tests, and none of us thought into simply
activating the warnings? :-)

-- 
Roberto Gordo Saez - Free Software Engineer
Linalco "Especialistas en Linux y Software Libre"
http://www.linalco.com/  Tel: +34-914561700



Reply to: