Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Macros (Was: fdtable)



>When reading other people's code, I've regularly been bitten by the
>fact that the code was not what it looked like, due to a #define in
>one of the so many header files that was (directly or indirectly)
>included.  The potential for errors is much less if one keeps all
>macros uppercase.  So create a SIGNED macro that is either defined to
>signed or to nothing, like EXTERN.

In the case of signed, I disagree.  The signed keyword usually has no
effect at all, so #defining it to nothing makes almost no difference to
its meaning.  const, similarly, is purely a modifier, and #defining it
to nothing makes no difference to the meaning of the code, provided
it's legal to start with.  The EXTERN macro is uppercase because it
doesn't simply mean extern; it means extern in most source files, but
it is different in one.

-zefram




Messages sorted by: Reverse Date, Date, Thread, Author