|
From: Jan W. <we...@ef...> - 2009-11-16 10:39:13
|
This is a well-documented feature, see e.g.: http://sdcc.sourceforge.net/doc/sdccman.html/node182.html "Certain words that are valid identifiers in the standard may be reserved words in SDCC unless the --std-c89 or --std-c99 command line options are used. These may include (depending on the selected processor): [...] 'data' [...]. Compliant equivalents of these keywords are always available in a form that begin with two underscores, f.e. '__data' instead of 'data'." Jan Waclawek ----- Original Message --------------- Subject: [Sdcc-user] Another compiler glitch: Is 'data' a pre-definedkeyword? From: Gordon Henderson <gor...@dr...> Date: Mon, 16 Nov 2009 09:36:10 +0000 (GMT) To: sdc...@li... > >This (contrived example) fails to compile: > > void test (int data) > { > int i ; > i = data ; > } > >Compile command: > > sdcc -mpic16 -p18f4685 -c test.c > >Gives: > > test.c:5: syntax error: token -> 'data' ; column 10 > test.c:6: error 159: in function test: name omitted for parameter 1 > >Compiles fine with gcc, so wondering if 'data' is pre-defined as a keyword >somewhere? > >Noticed this when porting code from an AVR platform (using gcc-avr) - it's >not drastically important, as I've just renamed 'data' in my code to >something else which then compiles and works fine, but FYI... > >Thanks, > >Gordon |