This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
egcs-19990228 const ignorance bug
- To: egcs-bugs at egcs dot cygnus dot com
- Subject: egcs-19990228 const ignorance bug
- From: Oskar Enoksson <osken393 at student dot liu dot se>
- Date: Thu, 4 Mar 1999 20:36:29 +0100 (MET)
- Reply-To: Oskar Enoksson <osken393 at student dot liu dot se>
I think constness is violated in the code below. In any case, declarations
like this seem to cause ICE's in more complicated code.
///// Begin error.cpp /////
int main() {
char **text;
*text="Hi"; // Should be an error IMHO.
(*text)[1]='o';
}
///// End error.cpp /////
with egcs-2.93.10 on alphaev56-dec-osf4.0d:
> c++ -Wall --ansi --pedantic error.cpp -o error
> ./error
Segmentation fault
>
Regards
/Oskar