Commit Graph

242 Commits

Author SHA1 Message Date
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
martin cee04f319f No need to avoid long double on sparc64 any more. 2003-09-19 16:37:59 +00:00
lukem a93ea220fc Rework how dependency generation is performed:
* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
  This is a change of behaviour.  If a Makefile wants the clean semantics
  it must specifically append to CLEANFILES.
  Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
  that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d  depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".
2003-08-01 17:03:41 +00:00
christos fb6b32b11b Back out debugging Makefile. 2003-05-30 13:38:09 +00:00
christos e3071c679b PR/21706: Krister Walfridsson: CVT nodes not handled in ?: expressions. 2003-05-30 13:37:49 +00:00
christos 7d2c2eeaea - make all targparam.h files consistent with the arch includes
- add a new INTPTR_IS_LONG define and use it.

- XXX: the PTRDIFF, SIZEOF, INTPTR defines really make lint more relaxed
  in some platforms than others. We should really be looking for the
  particular tokens to enable this kind of checking. I.e.
  now:

	char *p;
	int foo = (int)p;

  does not produce a warning on INTPTR_IS_LONG == 0 platformas.
  In reality it should only elide the warning if:

	char *p;
	int foo = (intptr_t)p;

  but it is not that smart (yet).
2003-05-29 18:12:13 +00:00
christos 0fe2b9e22b handle void ({ }) 2003-05-24 22:17:46 +00:00
simonb f7ed8a7482 Move one group of #define's so this looks more like ilp32.h. 2003-05-21 12:09:39 +00:00
christos 1a57478e96 Better implementation of ({}) gcc extension. 2003-05-20 13:59:32 +00:00
kristerw 8e46e7bae0 Prevent use of stale pointer for determining return type of ({ })
expressions.

Details:
lint did fail on constructs like

   struct foo *x;
   x = ({ struct foo *y; /* do stuff */; y;});

since it gave the whole ({ }) the same structure representing the
type as y, but that structure is reclaimed when y goes out of scope.
2003-05-18 23:30:00 +00:00
lukem 826a14607a Now that <bsd.prog.mk> DTRT if HOSTPROG is defined (i.e, it is a no-op),
there's no need to special-case .include-ing it.
2003-05-18 07:57:31 +00:00
wiz de87ca793d constant usually has two n. 2003-05-14 12:45:06 +00:00
dbj f1e0ecadf7 remove dependencies on ${LIBC} ${LIBM} and ${LIBTERMCAP} static libraries
from host tool targets.  Commits fix from PR toolchain/21495
2003-05-14 00:24:06 +00:00
lukem ef83aa34d9 clear errno before strto(u)l() if we're going to test it for ERANGE afterwards 2003-04-18 03:21:00 +00:00
wiz 0aa9f9348a Fix part of last. 2003-04-08 21:09:40 +00:00
jmmv d20b88e377 Homogenize paragraphs to begin with capital letter. Fixes my own PR misc/18773. 2003-04-08 17:25:15 +00:00
wiz 990562bfef .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
2003-02-25 10:34:36 +00:00
simonb 276fd1665c The Double-Semi-Colon Police. 2003-01-20 05:29:53 +00:00
wiz c6f1277bfa synchronous, not syncronous. 2003-01-06 13:10:25 +00:00
thorpej 8fb0e9f9e9 Include <string.h> for prototypes. 2002-12-06 03:27:39 +00:00
thorpej 7d013a7ef5 Skip passing -$ to the preprocessor, for now. 2002-11-24 20:24:54 +00:00
christos 67dc335c98 PR/18896: Jason Thorpe: C99 structure member initializers broken for arrays.
XXX: The checking done does not work, but the code passes.
2002-11-13 21:50:57 +00:00
perry 5f042d3d69 add a comment on c99ism noting that the logic might be wrong but we
haven't yet decided on what combinations of -s and -S really are
intended to mean yet.
2002-11-02 20:14:10 +00:00
perry 22f5530a1a Make long long a c99ism, not a gnuism. 2002-11-02 20:10:16 +00:00
perry cca1626bfa add c99ism(), by analogy to gnuism(), for c99 construct (un)warnings 2002-11-02 20:09:27 +00:00
perry ab74747a8d 1) // is only for c99 or gcc
2) inline is acceptable in c99 -- create a new c99 keyword class.

XXX The handling of sflag and Sflag is utterly bogus throughout this
pass. I think I have to make some adjustments.
2002-11-02 01:42:22 +00:00