This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
An Ansi-C question or... Is egcs/gcc Ansi compliant?
- To: egcs mailing list <egcs at cygnus dot com>
- Subject: An Ansi-C question or... Is egcs/gcc Ansi compliant?
- From: esoft at arrakis dot es (Enrique I.R.)
- Date: Wed, 30 Dec 1998 10:24:45 GMT
Hi.
Just playing with const:
const int i=0;
i++;
printf("%i\n",i);
You get a warning only (increment of read-only variable) and then both compiles
(egcs&gcc) and 'i' is modified at runtime. I was perplexed and checked this with
other compilers (OSF's, vc++, bcb) and couldn't even compile this.
Why ignore egcs/gcc the const keyword such way?
Is there anyway to get a real const with egcs?
PS: I don't know this message is really on-topic here. If you know of a mailing
list this could fit better, please tell me.
(for USENET postings) Delete 'CUTTHIS' from my e-mail to reply.
-----------
Enrique I.R.
Freelance Sofware Developer.
Gran Canaria. Spain.
--aka CtrInt on #Linux--