[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug?: cpp doesnt recognize dollar signs in indentifiers



This is on STABLE (3.0), using gcc 2.95.4 .
Calling cpp directly as per the manpage  suggests that the
dollar signs will be parsed. It specifically says that unless I
add the -$ flag to -disable- dollarsigns, it won't. Which implies
it supports them by default.Well, it doesn't work and I've tried MANY
different combinations. The code I'm working with looks like this.

/*
** UBCSA -- Utility Bus Chip Select A Register
*/
#define sio$ubcsa_rtc           (1 << 0) /* 1 enables RTC locations 70h-77h
*/
#define sio$ubcsa_kbd           (1 << 1) /* 1 enables kbd ctlr loc. 60h, 62h,
66h   */
#define sio$ubcsa_fl_3f2        (1 << 2) /* bits[5,3:2]=001 floppy loc.
3F2h-3f7h   */
#define sio$ubcsa_ide           (1 << 4) /* IDE enable, look at 82378 spec
*/
#define sio$ubcsa_lbios         (1 << 6) /* 1 enables access to
FFFE0000h-FFFEFFFFh */
#define sio$ubcsa_xbios         (1 << 7) /* 1 enables access to
FFF80000h-FFFDFFFFh */


It looks like it truncates the line after it encounters the first $ as per the
errors
suggest.

io.h:438: warning: `sio' redefined
io.h:437: warning: this is the location of the previous definition
io.h:439: warning: missing white space after `#define sio'
io.h:439: warning: `sio' redefined
io.h:438: warning: this is the location of the previous definition
io.h:440: warning: missing white space after `#define sio'
io.h:440: warning: `sio' redefined
io.h:439: warning: this is the location of the previous definition
io.h:441: warning: missing white space after `#define sio'
io.h:441: warning: `sio' redefined
io.h:440: warning: this is the location of the previous definition
io.h:442: warning: missing white space after `#define sio'
io.h:442: warning: `sio' redefined

Here's the commandline I'm using.

cpp  -I. -I../../obj -I../../h -I../../palcode/lx164  -fdollars-in-identifiers
srom.s

I've also tried.

gcc -x
ssembler-with-cpp  -I. -I../../obj -I../../h -I../../palcode/lx164  -fdollars-in
-identifiers  srom.s

Adding -traditional or -traditional-cpp to the flags gives me the previous error
with an extra infinite error.

srom.s:3578: macro or `#include' recursion too deep
srom.s:3578: macro or `#include' recursion too deep
srom.s:3578: macro or `#include' recursion too deep
srom.s:3578: macro or `#include' recursion too deep
...

Now the firmware portion of the EBSDK is stuffed full of these sort of
definitions (there were two total in the tools section)and I would loath having
to edit every-single-file to replace a '$' with a '_'. Does anyone know of a way
around this? Much thanks in advance.

P.S. The relevant excerpt from the cpp manpage.

   -$     Forbid  the  use of `$' in identifiers.  This was formerly required
for strict 	    conformance to the C Standard before the standard was corrected.
This option 	    is available only when you call  cpp  di­rectly; gcc will not
pass it from its
          command line.

Peter
--
www.linuxalpha.org	www.alphadriven.org
Peter Petrakis         Warrior/Engineer        voodoo@alphadriven.org
"<BLAM!!> Who the hell are you!? Name's Ash <click clock> Housewares..."



Reply to: