preventing sign extension
Doug Gwyn
gwyn at smoke.BRL.MIL
Wed Jan 11 18:13:56 AEST 1989
In article <905 at thor.stolaf.edu> edf at rocky2.rockefeller.edu writes:
>#define INTMASK (long) ((unsigned) (0))
Almost certainly this was supposed to be
#define INTMASK ((long)(unsigned)~0)
The form you gave should not have worked on ANY C compiler.
Are you reading that from a magazine listing? They're
notorious for goofing up "funny" symbols like ~, `, and \.
More information about the Comp.lang.c
mailing list