Mail Archives: djgpp/2000/02/15/01:46:39
> I was wondering why you can do this when I was told just a few weeks ago
> that I shouldn't use the underscore character in my header declaration.
> ie, In your example, I shouldn't use __example_h_ , everyone told me
> that it should be changed to example_h_ in order to use good programming
> style. Please, I would just like an explanation of why I was told
> this. Thanks for your time.
If I recall correctly, it -is- considered a no no, and I probably shouldn't
have used that as an example, but I've been writing a DJGPP DPMI compatible API
library for Watcom C, and tried to make everything as DJGPP'ish as I could.
The reason you shouldn't prefix symbols (either preprocessor or
variables/functions), is because a lot of system calls usually begin with the
underscore. It's sort of unofficially reserved for the compiler
implementation. If you do do it, you just have to be careful you aren't
redefining a symbol that's already part of your particular implementation. I
feel I can get away with this, because I know Watcom fairly well. :)
AndrewJ
- Raw text -