if ((flags & (1 | 2) == 0) || (flags & (1 | 2) == (1 | 2)))
to
if (!(flags & 1) ^ !(flags & 2))
which works because ! returns 1 or 0, making the ^ an ^^, and
because XOR survives NOTting its arguments
gcc, SUNWcc, pcc, llvm-gcc, clang, etc. all didn't say a thing!
now compiles warning-free (testsuite pass) on ULTRIX 4.5 (1986),
and OSF/1 X2.0-8 (testsuite norun: perl missing) has only the usual
bitchings about "volatile sig_atomic_t" because the latter part is
already volatile, but otherwise warning-free compile, works fine
of sanitising; since this is supposed to be the lightweight allocator,
with the guarding allocator coming back in later, remove it
reduces memory consumption below what espie's allocator used ☺
12:58⎜<gps23:#ksh> someone please tell me why: code=1; if [ "code" -eq 1 ] returns true
13:10⎜<mira|AO:#ksh> hm but I see the problem
13:10⎜<mira|AO:#ksh> code=1; x=code; [ "$x" -eq 1 ]
13:10⎜<mira|AO:#ksh> this is indeed unexpected
13:10⎜«pgas:#ksh» gps23: code=1+1;[ "code" -eq 2 ] && echo true #also works
as of now, we consider
13:13⎜«pgas:#ksh» gps23: when you use -eq there is something like an implicit $(( )) around the
⎜ arguments
13:14⎜«pgas:#ksh» [ code -eq 1 ] is the same as [ $((code)) -eq 1 ]
to be documented.
[11]select for diffs
Sun Mar 1 20:11:06 2009 UTC (2 weeks, 6 days ago) by otto
Branches: [12]MAIN
CVS tags: [13]HEAD
Diff to: previous 1.17: [14]preferred, [15]coloured
Changes since revision 1.17: +17 -9 lines
Fix PR #[16]723: [17]test(1) operator precedence inconsistent with POSIX
Make sure ksh builtin test and [18]test(1) do not differ.
From Christiano Farina Haesbaert. ok miod@
[11]select for diffs
Sat Feb 7 14:03:24 2009 UTC (6 weeks, 1 day ago) by kili
Branches: [12]MAIN
CVS tags: [13]OPENBSD_4_5_BASE, [14]OPENBSD_4_5, [15]HEAD
Diff to: previous 1.32: [16]preferred, [17]coloured
Changes since revision 1.32: +2 -2 lines
Ensure that *wp isn't NULL.
ok otto@