I've traced the file that does the optimization to /usr/src/gcc-4.3/gcc-4.3.3/gcc/builtins.c
The functions are fold_builtin_printf() fold_builtin_sprintf() the functions return a tree that seems to point straight to some puts() or putchar() construct that return tree should be modified to include a null check I'm posting this preliminary research in case anyone already knows the gcc tree struct and can easily patch it -- Printf inconsistency when handed null string https://bugs.launchpad.net/bugs/193795 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs