tech-toolchain archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bmake: variable modifiers in SysV include
On Apr 4, 10:10am, kre%munnari.OZ.AU@localhost (Robert Elz) wrote:
-- Subject: Re: bmake: variable modifiers in SysV include
| Is there some reason a var that is only ever 0 or 1 needs to
| be a size_t ? It should be const.
It does not matter, the compiler DTRT's and it is an index.
| (It could also be just:
| const int o = line[0] == 's' || line [0] == '-';
| though I know some people really dislike using C like this for
| some bizarre reason -- it is the way it is defined to work, and it
| is simpler and easier to follow.)
I've been burned by pre-ansi compilers that did TRUE = -1 (mac) and
since then I can't bring myself to trust them :-)
| static const char include[] = "include";
|
| and use "sizeof include - 1" (probably via a #define, or
| another const int)?
sure.
| (And of couse use this instead of the string "include" in
| the strncmp.)
Yes.
christos
Home |
Main Index |
Thread Index |
Old Index