From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet To: egcs-bugs@cygnus.com Subject: Bug report Date: Tue, 29 Sep 1998 06:53:00 -0000 Message-id: <3610E64A.87AE7CC9@COSMOSBAY.COM> X-SW-Source: 1998-09/msg00931.html List-Id: Hi all This little C++ program is incorrectly compiled by egcs 2.91.57 It seems to be a generic bug. (targets tested : SCOV5, sparc solaris 2.4) #include const char * const strvar = "@(#)ident" ; int main(int argc, char *argv[]) { printf("%lx '%s'\n", strvar, (strvar == 0) ? "(null)" : strvar) ; return 0 ; } egcs -o try try.C The result is : 8049258 '(null)' which is obviously wrong. Tips: If I have 'const char *strvar = "..." ;' it is correctly compiled. If I use a C file instead of C++, the bug is not present. Is this bug already known ? Thanks Eric Dumazet