Commit Graph

308 Commits

Author SHA1 Message Date
matt
c58ed3675c Add the complex types to the floating point promotion rules. 2008-09-27 02:30:46 +00:00
matt
2ded04cde2 Add a missing label for LCOMPLEX 2008-09-26 23:51:04 +00:00
matt
9364aa71ae Teach lint about long double _Complex (C99) 2008-09-26 22:52:24 +00:00
joerg
8a89a3dc54 Check value range of ULONG and UQUAD values. On 32 bit platforms like
i386 "unsigned long x = 0x800000000UL;" passed lint and gcc complains
(rightfully). Validate quad as well to allow using a potentially larger
type to store the value.
2008-09-10 14:05:00 +00:00
gmcgarry
15631ee3b4 Undefine __PCC__ the same as __GNUC__ inside lint. 2008-08-29 00:44:48 +00:00
apb
4e07a05b2d Lint predefines the following symbols: "__LINT__", "lint", "__lint", and
"__lint__"; not only "lint" as the man page previously claimed.
2008-08-02 12:05:48 +00:00
christos
2703aa2d0d enable -P 2008-07-31 15:25:18 +00:00
christos
8bba9bd7b0 document P 2008-07-31 15:24:09 +00:00
christos
3457928c2a Add Picky flag; this produces more warnings:
1. long a; int i; a = i * i;
   suggests casting i to long, so that we gain precision in the multiplication.
2. warns about magnitude comparisons in enums.
3. warns about possible sign extension issues when integer types become widened.
2008-07-31 15:21:34 +00:00
dsl
d4d6980a4b Add a check for 'continue' inside a 'do ... while (0)' loop.
'continue' has the same effect as 'break' - as that probably isn't
what the writer had in mind!
2008-07-25 18:33:53 +00:00
christos
26acf9f9d6 don't check for NaN if fpe. 2008-05-03 16:28:56 +00:00
christos
00c6e78061 Since we cannot guarantee that all machines do ieee math, or that they have
the proper math setup deal with SIGFPE directly.
2008-05-02 15:10:05 +00:00
christos
ee5dd5c8d7 fix const and volatile printing in types. 2008-05-01 21:52:19 +00:00
christos
1347903131 PR/38543: Valery Ushakov: Don't crash printing anonymous unions. XXX: Type
printing is phase2 is buggy since it does not print the qualifiers, but this
is for another day.
2008-05-01 15:39:33 +00:00
martin
11a6dbe728 Convert TNF licenses to new 2 clause variant 2008-04-30 13:10:46 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
christos
cb68ac0e9c print the types involved in an error. 2008-04-27 01:45:04 +00:00
christos
acfccdf2a5 reorder a couple of error messages. 2008-04-27 00:13:58 +00:00
christos
3123c3e08f Fix complex double to be '\0' instead of 'u', from Nicolas Joly. 2008-04-26 23:34:55 +00:00
christos
0ab7d1a4f5 same change: double is emitted as '\0' 2008-04-26 20:31:45 +00:00
christos
93cd306a8f make the complex float/double annotated consistently with regular float/double. 2008-04-26 20:11:09 +00:00
christos
67cf388a2b print the types involved in the mismatch. 2008-04-26 19:38:30 +00:00
christos
b965d925d7 - simplify logic in getting the filename index.
- fix an allocation botch.
2008-04-26 17:11:52 +00:00
christos
fec2a3517e fix "long double" type recognition which broke with the complex changes. 2008-04-26 16:14:23 +00:00
christos
e92259d4ee handle lintlibrary output of _Complex types. 2008-04-25 22:22:28 +00:00
christos
69ade9fd6e preliminary _Complex support.
NB: Does not really understand type conversions between complex and doubles.
2008-04-25 22:18:34 +00:00
christos
5f562aba67 handle case C1 ... C2: 2008-04-25 17:18:24 +00:00
dholland
e93a5674cc Add a little const. 2008-03-30 22:28:41 +00:00
christos
a23f0e5f81 PR/38142: YAMAMOTO Takashi: lint -S complains on variable length arrays 2008-03-04 02:41:46 +00:00
lukem
cd2d88332f Don't bring in -lutil for tools. 2008-01-11 00:38:10 +00:00
simonb
ccab3b34ce Remove support for NetBSD/pc532. 2008-01-10 13:40:36 +00:00
lukem
d7382668ef Convert to using raise_default_signal(3). 2008-01-10 05:15:07 +00:00
uwe
17bb5b2554 tlst[inptype(...)] is bad C code because inptype() can realloc tlst
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.
2007-09-28 21:53:50 +00:00
scw
5764a76889 Remove support for NetBSD/{,evb}sh5. 2007-04-08 09:35:21 +00:00
hubertf
6df5e55489 Remove unused ctype.h header.
Contributed by Slava Semushin <slava.semushin@gmail.com> in private mail.
2007-02-07 14:20:58 +00:00
he
3da5bad40a Add a cheesy workaround marked XXX for the situation where the
strtod() implementation available in the environment does not
handle hex floats.

Discussed with and suggested by christos
2007-02-06 00:08:31 +00:00
christos
e903e46b14 deal with hex doubles. 2007-02-02 20:02:18 +00:00
ad
c89ec7afee pushinit(): fix a use-after-free bug. 2007-01-20 21:16:23 +00:00
wiz
6c0754a434 Drop trailing whitespace. 2006-12-19 19:06:44 +00:00
christos
4ad17e5702 No need to leave a lot of space between the error number and the message. 2006-12-19 19:02:49 +00:00
christos
c613b70040 Xr lint 7; noticed by Anon Ymous 2006-12-19 19:00:20 +00:00
christos
f44d03be78 - add debugging to track nowarns
- make /*LINTED*/ take effect on unused functions
2006-11-08 18:31:15 +00:00
christos
39a6c2fdf2 allow 0 sized structs in c9x 2006-10-23 00:15:58 +00:00
christos
5ffa3fb1be add zero sized array handling. It is a little too chatty now. 2006-10-23 00:10:29 +00:00
scw
321742a838 Stick with unsigned long for _BSD_SIZE_T_ regardless of LP64/ILP32. 2006-10-22 11:20:44 +00:00
he
f0947b3081 The symbol to define to 1 if a pointer to an int fits in a long is
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.
2006-10-20 12:51:12 +00:00
he
e02c317333 Simplify the previous change. There's actually no need to treat constants
specially in ptconv(), the constants will be checked in convert() anyway.
2006-10-18 21:34:39 +00:00
he
4228dd3afb Partly redo when to emit warnings for argument type conversions.
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.
2006-10-18 00:01:19 +00:00
he
081971a032 Use __inline instead of inline, to allow linting of ourselves... 2006-10-17 23:53:30 +00:00
he
62e8b0f3fa Make a minimal attempt at distinguishing between the hosts and the
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.
2006-10-16 13:33:57 +00:00