Commit graph

9 commits

Author SHA1 Message Date
Tony Finch 5ac21f6976 Sync with upstream version:
* Ensure we work within the array bounds when parsing command-line options;
  * Replace h0h0getopt with getopt(3);
  * Use consistent whitespace style in the function declarations.

Revieweded by:	dwmalone (mentor)
2002-05-23 16:50:41 +00:00
Tony Finch 3f220dd51a Upgrade unifdef:
* It now knows about the existence of #elif which would have
    caused it to produce incorrect results in some situations.

  * It can now process #if and #elif lines according to the
    values of symbols that are specified on the command line.
    The expression parser is only a simple subset of what C
    allows but it should be sufficient for most real-world
    code (it can cope with everything it finds in xterm).

  * It has an option for printing all of the symbols that might
    control #if processing. The unifdefall script uses this
    option along with cpp -dM to strip all #ifs from a file.

  * It has much larger static limits.

  * It handles nested #ifs much more completely.

There have also been many style improvements: KNF; ANSI function
definitions; all global stuff moved to the top of the file; use
stdbool instead of h0h0bool; const-correctness; err(3) instead
of fprintf(stderr, ...); enum instead of #define; commentary.

I used NetBSD's unifdef as the basis of this since it has received
the most attention over the years.

PR:		37454
Reviewed by:	markm, dwmalone
Approved by:	dwmalone (mentor)
MFC after:	3 weeks
2002-05-15 16:30:28 +00:00
Warner Losh 3f330d7d1a remove __P 2002-03-22 01:42:45 +00:00
Mark Murray 54750e1d8a WARNS=2 fixes, use __FBSDID(), kill register keyword. 2001-12-11 23:20:23 +00:00
Dima Dorfman 7a19d1bbb9 Include missing header files which define functions for which gcc has
builtins (e.g., exit, strcmp).
2001-06-24 19:50:42 +00:00
Peter Wemm c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Philippe Charnier 014927909d Main() returns int. 1997-08-26 11:08:24 +00:00
Philippe Charnier cccb40360b Use err(3). Add usage(). Remove progname. 1997-08-20 11:07:53 +00:00
Rodney W. Grimes 9b50d90275 BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00