Mailing List Archive


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

Re: [tlug] lojza.h: release early, release often . . . . . . . .



>>>>> "Jim" == Jim  <jep200404@example.com> writes:

    Jim> I've learned to add parentheses around #define values as a
    Jim> matter of routine to avoid suprises.

Good luck!  There are all kinds of ways this can trip you up if you're
actually doing anything complex enough for it to help.  Really, you
should be aiming at exactly the necessary number of parentheses.  If
it starts turning into work to get them right, it's time to think
about strategies for avoiding use of #define.

You should use const (or enum for ints) and inline instead of macros
whenever possible.



-- 
School of Systems and Information Engineering http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba                    Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
               Ask not how you can "do" free software business;
              ask what your business can "do for" free software.


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links