Commit Graph

267 Commits

Author SHA1 Message Date
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
christos 2bd08fcc54 in the same way that we need an extra level for arrays, do the same for struct. 2006-10-15 18:18:54 +00:00
christos 3e006796cf previous fix broke array initializers. 2006-10-15 15:08:20 +00:00
dogcow 37bb4f935a do the #ifndef lint dance for __RCSID; also, include the appropriate
headers if cross-building the program in tools/.
2006-10-15 01:16:31 +00:00
christos e578e35910 Fix c99 initialization issues. Now the regression tests work. 2006-10-14 21:08:50 +00:00
peter e263dfd62f WFORMAT is no more... 2006-10-08 17:52:28 +00:00
matt 9e051a8002 Add enough configury glue so that src/tools can build a N64 mips toolchain. 2006-08-25 23:35:04 +00:00
christos eb251235c6 flex arrays are a c9x feature. 2006-07-13 17:49:29 +00:00
christos 692e9c49f5 PR/33984: YAMAMOTO Takashi: lint complains about typedef
The grammar for c99 initializers only looked for name tokens, so if there
was a typedef'ed name it failed. Fixed by looking at all identifier tokens.
2006-07-12 20:03:48 +00:00
mrg d1b9a6c456 allow powerpc64 lint to build (not really tested yet though.) 2006-06-29 23:41:28 +00:00
skrll 683ccd8e40 Add RCSId. 2006-04-17 06:53:06 +00:00
cherry fb4fa95282 xlint for ia64 2006-04-01 09:39:47 +00:00
christos a6ee606509 gcc says case is missing, coverity says case not reached. Appease both. 2006-03-22 16:16:59 +00:00
christos ec4e36f798 Coverity CID 46: Remove dead code. 2006-03-22 02:17:52 +00:00
christos 4b41923ad3 Coverity CID 198: Remove dead code if INT_MAX == LONG_MAX 2006-03-22 02:14:03 +00:00
christos ec166aba55 Coverity CID 199: make sure that rtp is not NULL before dereferencing. 2006-03-22 02:08:55 +00:00
perry 0f0296d88a Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 20:45:08 +00:00
perry cb4a630e29 in several comments:
implizit -> implicit
  explizit -> explicit
2005-09-24 15:30:35 +00:00
christos ddee551034 Handle C99 array range initializers:
type a[] = { [lo ... hi] = c }:
2005-07-17 19:35:48 +00:00
christos fd2a8295bb - make input errors print the lint source line number they are called from.
- simplify a conditional.
2005-07-16 19:54:00 +00:00
skd 14834f0865 Deal with void * types. Approved by Christos. 2005-06-14 03:40:31 +00:00
matt fe3f7b90ff Can't use _LP64 because xlint is a host tool. We need a new define for
when building as a host tool.
2005-06-12 16:56:59 +00:00
lukem 829384f829 appease gcc -Wuninitialized 2005-06-02 04:34:57 +00:00
christos 8b3f9b1455 Factor out tyname() so that it can be used both by lint1 and lint2.
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.
2005-04-07 16:28:40 +00:00
matt f19d600803 Don't include the powerpc64 definitions in here. Since lint is a host
tool, the hosts definition of _LP64 will confuse things.
2005-02-19 17:15:56 +00:00
dsl a7126d6435 Only pass -Wtraditional to cpp for lint -t ...
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.
2005-02-09 21:24:48 +00:00
christos edf98457e5 sync with reality. 2005-01-26 09:04:49 +00:00
christos 5f325e6da0 Shift assignment operators were handled incorrectly. On 64 bit machines,
unsigned long x, y;
	x <<= y;
always produces a warning because y is casted to int. Handle them instead
the same way as regular shifts.
2005-01-02 17:59:47 +00:00
christos 2f2c6dc261 say from what type to what time we are converting. 2005-01-02 10:40:49 +00:00
yamt 2e1baea952 recognize _Bool. 2004-09-12 08:58:52 +00:00
yamt 496bd8a26d recognize C99 array initializer designators. PR/18896. 2004-08-03 12:11:54 +00:00
jmc b2f782612f Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')

Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).

Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.

Fixes PR's: PR#17762 PR#25944
2004-06-20 22:20:14 +00:00
wiz 5ad6c16fa8 Bump date for previous. 2004-01-26 21:59:42 +00:00
dsl c08c3c342b Pass -MD through to cpp so that it can generate a depend file.
(Actually pass any -M <arg> through, but -MD is most useful.)
2004-01-26 21:51:11 +00:00
lukem 171d653219 Overhaul how `build.sh tools' are used:
*	Rename "config.h" to "nbtool_config.h" and
	HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
	This makes in more obvious in the source when we're using
	tools/compat/config.h versus "standard autoconf" config.h

    *	Consistently move the inclusion of nbtool_config.h to before
    	<sys/cdefs.h> so that the former can provide __RCSID() (et al),
    	and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
	#if HAVE_NBTOOL_CONFIG_H
	#include "nbtool_config.h"
	#endif
to the top of the source files (for the general case).
2003-10-27 00:12:41 +00:00
christos 2a2701085e - keep the fd to /dev/zero open
- take advantage of MAP_ANONYMOUS
2003-10-22 16:10:03 +00:00
christos 58507d43c3 PR/23219: Dan McMahill: Make this compile on system that don't have MAP_ANON.
Centralize the mmap allocations in a new function, xmapalloc() that handles
this.
2003-10-21 23:58:53 +00:00
lukem 130ab7336b Rework how MAKEVERBOSE operates:
*	Don't bother prefixing commands with a line of  ${_MKCMD}\
	and instead rely upon "make -s".  This is less intrusive on
	all the Makefiles than the former.  Idea from David Laight.

    *	Rename the variables use to print messages.  The scheme now is:
	    _MKMSG_FOO		Run  _MKMSG 'foo'
	    _MKTARGET_FOO	Run  _MKMSG_FOO ${.TARGET}
	From discussion with Alistair Crooks.
2003-10-21 10:01:19 +00:00
lukem c545cc169d support MAKEVERBOSE 2003-10-19 04:30:30 +00:00
lukem a694177df5 support MAKEVERBOSE and use ${HOST_SH} 2003-10-19 04:25:00 +00:00
itojun d5250e4ec9 safer use of realloc 2003-10-16 06:34:19 +00:00
martin c88a5e7be4 Lint is a host tool - leave the sparc64 hack in place if compiling with
an old compiler.
2003-09-21 17:06:40 +00:00