Commit Graph

75 Commits

Author SHA1 Message Date
lukem 98e5374ccb Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
2008-07-21 14:19:20 +00:00
drochner 93e3fc3cf6 thanks David, but the initialisation might not work, dependent on
the %union used -- remove the "const" instead (and add a "static"
which desn't seem to hurt)
2008-07-18 14:25:37 +00:00
dsl 6889d181fd groff puts this code through g++ which is rather happier if we give
yyvalzero an initialiser.
2008-07-18 09:57:15 +00:00
drochner f2e25e0cba fix a longstanding bug, from Otto Moerbeck:
if we're reducing a rule that has an empty
right hand side and the yacc stackpointer is pointing at the very
end of the allocated stack, we end up accessing the stack out of
bounds by the implicit $$ = $1 action

do it a bit differently than in Openbsd: avoid pulling in <string.h>
because this is not compatible with wacky namespace games we do in libc
2008-07-17 16:28:14 +00:00
perry d4b751b032 Remove lots of redundant __attribute__((__noreturn__))s
The lines already had __dead on them. I wonder why they had both...
2007-12-15 22:01:25 +00:00
perry 8b0f9554ff convert __attribute__s to applicable cdefs.h macros 2007-12-15 19:44:37 +00:00
christos 1665d5e960 fix spelling of accommodate; from Zapher. 2006-11-24 19:46:58 +00:00
jnemeth 0b1276d17c Coverity annotation 2006-05-25 21:43:40 +00:00
christos 16aa23f5c3 sort static and non-static decls. 2006-05-24 18:06:58 +00:00
christos 8d1d34adc0 - ansi prototypes
- sprinkle static
No functional change (just smaller binary because of unused functions)
2006-05-24 18:01:43 +00:00
christos dc2a3a037e Sprinkle __dead 2006-05-03 18:08:24 +00:00
christos d64e64f832 Coverity CID 545: Appease coverity. return early if the locally allocated
memory is not going to be used (this is an impossible case).
2006-04-22 18:16:13 +00:00
christos df780f7c38 Coverity CID 546: Add assertion before de-reference. 2006-04-22 18:08:13 +00:00
christos 30a161cf4d PR/21177: Christian Biere: ctype function issues. 2005-04-17 17:16:37 +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
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
agc 89aaa1bb64 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22365, verified by myself.
2003-08-07 11:13:06 +00:00
itojun 01a5c755ee use bounded string op, simplify by asprintf/strdup 2003-07-14 11:45:18 +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 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
kristerw 4786f258bd Make yacc emit plain ANSI C prototypes instead of __P() wrapped ones.
Per discussion on tech-toolchain.
2003-01-05 21:38:50 +00:00
tv e413f98bb4 In the generated C file, don't assume that <sys/cdefs.h> exists. Instead,
imply it with the <stdlib.h> include already present in the file, and
provide a compatibility definition for __P().
2002-01-31 21:01:15 +00:00
tv 335cf252cf Only invoke __RCSID/__COPYRIGHT if these macros exist. 2002-01-30 20:38:49 +00:00
tv 2bf5ae19a1 Use __P((void)) for the function *definitions* of yygrowstack() and yyparse()
(not just their declarations) to make newer C++ compilers happy with the
output.  (Needed to make yacc produce less iffy code for src/tools/groff.)
2002-01-30 20:37:59 +00:00
tv a328e34106 Make almost all tools compile and run properly on non-NetBSD hosts. (In
particular, most tools now run correctly on Solaris 7.)
2002-01-29 10:20:28 +00:00
tv dba5d44670 Add hooks to allow toolchain bits to be reachover-built at the top level. 2001-08-14 10:18:26 +00:00
christos 91869b8cb5 remove duplicate prototypes. 2001-02-04 17:45:24 +00:00
christos e670f72960 move yyparse prototype higher up, so that it is available to embedded c
code in the .y file.
2001-02-04 17:45:06 +00:00
jdolecek 0e4f8029c1 Make the generated parse tables const, so that the data are pushed
to text segment. The difference is quite significant - for example,
the tables are about 20K for gawk, 40K for nawk, couple of KB for /bin/sh.
2001-01-23 22:31:40 +00:00
jdolecek b6fcf9e157 make data arrays in skeleton.c const 2001-01-23 15:35:01 +00:00
lukem c2b84904ae use %ll_ instead of the less standard %q_ 2001-01-04 23:05:54 +00:00
is 135600f947 More format string cleanup by sommerfeld. 2000-10-11 14:46:00 +00:00
explorer e32bc6b6c4 Use
const char *yyname[] = {...};
	const char *yyrule[] = {...};
rather than
	char *yyname[] = {...};
	char *yyrule[] = {...};

to prevent warnings about
	initialization discards `const' from pointer target type
when the output of yacc is compiled with a picky warning level.
2000-06-07 23:54:17 +00:00
explorer 7e9d7f75aa make change to the yacc output bits, not to the yacc binary bits 1999-10-29 16:41:51 +00:00
explorer 3cdbacc45a defined(__NetBSD__) && defined(__RCSID) 1999-10-29 16:35:46 +00:00
explorer 2e74cdd712 Only use __RCSID() if defined(__NetBSD__) so the yacc output files can
be used on non-NetBSD platforms, too.
1999-10-27 20:28:11 +00:00
ross 4eb3fc58ba Missing .El, extra Pp. 1999-03-09 03:34:56 +00:00
christos d594b7c039 char -> unsigned char 1998-12-19 20:03:49 +00:00
itohy 868f04b4ca Eliminate memory leaks. 1998-10-10 20:45:59 +00:00
ross f670fa10c5 Add { and } to shut up egcs. Reformat the more questionable code. 1998-08-25 20:59:36 +00:00
perry 3fe138c146 RCS Id Police. 1998-01-09 08:03:16 +00:00
mycroft af96feb61b Format police. 1997-10-31 07:46:08 +00:00
christos a3882f2e6f PR/4392:John F. Woods: yacc -o file.cpp curdles result 1997-10-30 16:41:49 +00:00
lukem 2653d455ad fix .Nm usage, don't geenrate register in skeleton code 1997-10-20 03:41:12 +00:00
christos 6dea7d9ed2 Fix another gcc warning. 1997-09-26 15:14:08 +00:00
perry 9f1056ccbf Major modernization.
1) register variables have been killed, except for the ones in the
   generated skeleton (which should probably also be killed soon).
2) __P(())ified prototypes for all functions.
3) new style __RCSID's, and #include <sys/cdefs.h>'s.
4) all warnings generated with WARNS=1 (i.e. all warnings you get from
   gcc with -Wall -Wstrict-prototypes -Wmissing-prototypes) have been
   fixed, although not always in the best possible way.

in particular on #4, in a couple of places I got "control reaches end
of non-void function" errors, and sadly __dead doesn't seem to really
work, so I inserted a couple of exit() calls in strategic
places. These should be nuked if someone can get __dead to Do The
Right Thing.

There were also a couple of places where "while (foo = bar)" things
cropped up and I didn't do the best conceivable thing, but I usually
did.

These fixes should probably go back to the byacc maintainers.
1997-07-25 16:46:27 +00:00
perry bccc3d5d81 add -o option -- submitted in pr-1857 by Niklas Hallqvist 1997-07-19 19:47:38 +00:00
christos 1f54dc36dd Use mkstemp 1997-06-18 19:08:29 +00:00
christos f8c7b1919f Kill warnings in skeleton for gcc -Wall 1997-06-18 19:08:05 +00:00
mikel 0ad5b3127c make -p affect all variables; PR bin/2997 1997-01-15 07:24:25 +00:00