[Ilugc] Ansi C and 'const' modifier

  • From: sridharinfinity@xxxxxxxxx (Sridhar R)
  • Date: Wed Aug 11 16:44:39 2004

This program 

const int a=10;
a=20;

when compiled with 'gcc' it gives only warning about modification of
const object.  I think [1] according to ANSI Standard that should be
error.

Bug in gcc? or in my understanding?

[1] Not sure, I don't have the standards doc.  Even this
(http://freebooks.by.ru/view/CProgrammingLanguage/appa.html ;) is not
complete
-- 
Sridhar - http://cs.annauniv.edu/~rsridhar
Blog: http://www.livejournal.com/users/sridharinfinity

Other related posts: