g***@sdf.org
2012-01-17 16:56:17 UTC
Hi list,
I try to compile a very simple program with pcc (on Debian, AMD64, latest
CVS sources):
int main () { printf ("%.10f", 10.0); return 0; }
$ pcc foo.c
$ ./a.out
Segmentation fault
$ gdb a.out
GNU gdb (GDB) 7.2-debian
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from a.out...(no debugging symbols found)...done.
(gdb) run
Starting program: a.out
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7aa618e in __printf (format=0x4004e0 "%.10f") at printf.c:30
30 printf.c: No such file or directory.
in printf.c
(gdb) bt
#0 0x00007ffff7aa618e in __printf (format=0x4004e0 "%.10f") at printf.c:30
#1 0x000000000040049d in main ()
Is there a way to make this work? I tried various alternatives (sprintf,
fprintf, etc.), but all of them seems to segfault with floats and doubles)
:(
Thanks in advance,
--ghe
I try to compile a very simple program with pcc (on Debian, AMD64, latest
CVS sources):
int main () { printf ("%.10f", 10.0); return 0; }
$ pcc foo.c
$ ./a.out
Segmentation fault
$ gdb a.out
GNU gdb (GDB) 7.2-debian
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from a.out...(no debugging symbols found)...done.
(gdb) run
Starting program: a.out
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7aa618e in __printf (format=0x4004e0 "%.10f") at printf.c:30
30 printf.c: No such file or directory.
in printf.c
(gdb) bt
#0 0x00007ffff7aa618e in __printf (format=0x4004e0 "%.10f") at printf.c:30
#1 0x000000000040049d in main ()
Is there a way to make this work? I tried various alternatives (sprintf,
fprintf, etc.), but all of them seems to segfault with floats and doubles)
:(
Thanks in advance,
--ghe