public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* 3.1.1 RedHat 6.2 --- cerr NULL stops program execution???
@ 2002-10-11 21:21 Anibal Jodorcovsky
  0 siblings, 0 replies; only message in thread
From: Anibal Jodorcovsky @ 2002-10-11 21:21 UTC (permalink / raw)
  To: gcc-help

Hi there,

I finished compiling g++ 3.1.1 under Redhat 6.2. It took a while but it went
without a hitch. Aside from having to recompile boost in order to work with
my full project I didn't have too many problems. Great!

I'm fixing a whole lot of code that used to compile ok in 2.95.3 and it
doesn't anymore, mostly due to std:: and namespaces conflicts. It's good
that g++ is now stopping us :-)

But I was doing regression testing on one library I had written and found
something weird. I can now reproduce it with only a few lines:

#include <iostream>

int
  main()
{
    const char* const c1 = "C1";
    const char* const c2 = "C2";
    const char* const d  = NULL;
    const char* const c3 = "C3";

    std::cerr << "c1 is " << c1 << std::endl;
    std::cerr << "c2 is " << c2 << std::endl;
    std::cerr << "d  is " << d << std::endl;
    std::cerr << "c3 is " << c3 << std::endl;
    return 0;
}

This is the output:

[anibal@anibal C++]$ g++ -Wall jj.cpp
[anibal@anibal C++]$ ./a.out
c1 is C1
c2 is C2
d  is [anibal@anibal C++]$

See? c3 never got printed out. The program seems to terminate when printing
out NULL.
This used to work fine in 2.95.3.

These are my versions:

d  is [anibal@anibal C++]$ g++ --version
g++ (GCC) 3.1.1
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[anibal@anibal C++]$ uname -a
Linux anibal 2.2.14-5.0 #1 Tue Mar 7 21:07:39 EST 2000 i686 unknown
[anibal@anibal C++]$

[anibal@anibal C++]$ cat /etc/redhat-release
Red Hat Linux release 6.2 (Zoot)

Can anybody let me know what's going on here?

thanks,

-Anibal

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-10-12  4:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-11 21:21 3.1.1 RedHat 6.2 --- cerr NULL stops program execution??? Anibal Jodorcovsky

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).