odd error

Posted by Frobozz on Fri 26 Nov 2004 03:29 AM — 6 posts, 22,896 views.

#0
make -s smaug
Compiling o/build.o....
cc1: warnings being treated as errors
build.c: In function `edit_buffer':
build.c:5419: warning: declaration of `x' shadows previous local
make[1]: *** [o/build.o] Error 1
make: *** [all] Error 2
#1
Was trying to edit the buffer to use this format snippet:

http://www.afkmud.com/scripts/download.php?file=Sadiq/Format.txt

Happy Thanksgiving to those that celebrate!
#2
Just trying to find out what the error means. Sorry for the three posts in 5 minutes, out of it!
Australia Forum Administrator #3
Wasn't this answered here recently?

http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=4895
#4
My apologies,

I didnt realize that -
warning: declaration of `x' shadows previous local
warning: declaration of `last_char' shadows global declaration

were the same thing.
USA #5
It's not quite the same thing, but the difference is really trivial between this case and your previous problem. It's the same problem of variable shadowing.

e.g.
int a;
void foo()
{
  int a; // shadows previous global a
  while ( 1 )
  {
    int a; // shadows previous local a
  }
}