and there's no intermediate sequence point! We actually hit this on
sh3 with -O2 where gcc4 caches tlst in a register prior to recursive
call to inptype() and if you are unlucky the recursive call needs to
realloc tlst.
Introduce a temp variable to force a sequence point.
INTPTR_IS_LONG, not INTPTR_IS_ULONG -- the latter is unused in
other parts of lint's code. This stops vax's lint from complaining
about conversion of integer constants to 'unsigned long' in function
argument lists, via a proper define of INT_RSIZE in common/inittyp.c.
sh3 defined this to 0, so was actually not affected, but better to
eradicate the typo there as well.
Remove the apparently always true "styp(nt) != SHORT" part of the
innermost test. Allow atomatic conversion of literals as long as
they fit into the target type.
This should fix some of the lint issues in proplib on some of our
platforms.
Approved by christos.
targets integer data type value ranges. For now we just use the
hosts uint64_t for parsing & storing integers constants, and test
against the targets limits and assign appropriately, instead of
sometimes (inappropriately) going via the hosts u_long type. As
long as none of our architectures have target long or quad data
types strictly larger than 64 bits, we should be fine with this
fix.
Furthermore, as they stand at the moment, we can't use the current
TARG_INT_MAX and TARG_LONG_MAX constants in C preprocessor expressions,
so remove the conditional on them being equal. Yes, this will
produce dead code for some targets.
This allows an ilp32 host to lint for an lp64 target which uses
e.g. the targets ULONG_MAX constant without triggering an "integer
constant out of range" warning.
OK'ed by christos.
Since type_t is different between lint1.h and lint2.h include the
appropriate file depending on the pass. Make the argument mismatch
error print the type names of the types involved. Now that we have
a tyname() function we can fix the rest of the pass2 warnings to be
more explanatory, but not now.
Stops warnings about pre-processor constructs like #elif - which there is
no point detecting now that we've changed much of the code to require an
ANSI C compiler.