From: Erik P. <epe...@iv...> - 2003-08-12 09:46:51
|
On Wed, 6 Aug 2003, Tyler Montbriand wrote: > On Wednesday 06 August 2003 06:27 pm, Jesus Calvino-Fraga wrote: > > This is not a bug since 'data' as well as 'code', 'xdata', 'idata', and > > 'bit' are reserved words in SDCC used to define a storage class. See > > section 3.4 of the SDCC manual at: > > > > http://sdcc.sourceforge.net/doc/sdccman.html/node23.html > > > > Jesus > Interesting... I knew about those but I'd assumed it would be _data and such > like on some other compilers I've seen... but doesn't that mean that > allowing a variable called 'data' in the first place is incorrect? Perhaps > the error message could be made clearer, at least. I added a new warning message to SDCC. Now your sample program: int main(int argc, char *argv[]) { char data; data=0; return(0); } generates the warnings and errors: bugtest0001.c:4: warning: useless declaration (possible use of keyword as variable name) bugtest0001.c:5: parse error: token -> '=' ; column 7 -:0: error: code not generated for 'main' due to previous errors -:0: warning: in function main unreferenced function argument : 'argc' -:0: warning: in function main unreferenced function argument : 'argv' This change should make it into the snapshot in the next day or two. Erik Petrich |