public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/37765]  New: Printf of typed null pointer causes a run-time error
@ 2008-10-08  4:33 hosoda-t at palette dot plala dot or dot jp
  2008-10-08  7:38 ` [Bug c++/37765] " schwab at suse dot de
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: hosoda-t at palette dot plala dot or dot jp @ 2008-10-08  4:33 UTC (permalink / raw)
  To: gcc-bugs

#include <cstdio>
int main()
{
    printf("%s\n", (char*)0); // run-time error for g++ 4.3.2,
}                             // while ok for g++ 3.4.4

run-time error:
       10 [main] a 1808 _cygtls::handle_exceptions: Error while dumping state 
(probably corrupted stack) Segmentation fault (core dumped)

expexted behavior:print nothing or (null)
workaround: use cout
comment:
       Many people still prefer printf to cout. The disabled function make
printf almost useless.


-- 
           Summary: Printf of typed null pointer causes a run-time error
           Product: gcc
           Version: 4.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hosoda-t at palette dot plala dot or dot jp
  GCC host triplet: Microsoft Windows XP
GCC target triplet: i686-pc-cygwin


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-10-09  8:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-08  4:33 [Bug c++/37765] New: Printf of typed null pointer causes a run-time error hosoda-t at palette dot plala dot or dot jp
2008-10-08  7:38 ` [Bug c++/37765] " schwab at suse dot de
2008-10-08 23:03 ` hosoda-t at palette dot plala dot or dot jp
2008-10-08 23:07 ` pinskia at gcc dot gnu dot org
2008-10-09  2:42 ` hosoda-t at palette dot plala dot or dot jp
2008-10-09  8:20 ` paolo dot carlini at oracle dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).