Re: Bad gcc -O optimization cause core dump. What to do?

From: Andrey Chernov <ache_at_freebsd.org>
Date: Tue, 13 Mar 2007 16:08:05 +0300
On Tue, Mar 13, 2007 at 01:33:01PM +0100, Max Laier wrote:
> > It calls "puts(NULL)" with core dump.
> > It means "printf("%s\n", NULL)" is overoptimized.
> > BTW, things like "printf("1%s\n", NULL)" are not overoptimized.
> > Any ideas? Is it right or needs to be fixed?
> 
> See: http://www.ciselant.de/projects/gcc_printf/gcc_printf.html 3.1

So, treated as "not a bug" by gcc people. 
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15685

Sigh. It means printf-coding requires now intrinsic knowledge of gcc 
implementation details because our printf confusingly prints "(null)" too.
Convert printf back to segfault? ;)

-- 
http://ache.pp.ru/

Received on Tue Mar 13 2007 - 12:08:08 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:06 UTC