Commit graph

187 commits

Author SHA1 Message Date
Baptiste Daroussin 3e11bd9e2a Convert to usr.bin/ to LIBADD
Reduce overlinking
2014-11-25 14:29:10 +00:00
Simon J. Gerraty 488c975a1f Updated/new dependencies 2014-11-19 07:10:38 +00:00
Simon J. Gerraty 9268022b74 Merge from head@274682 2014-11-19 01:07:58 +00:00
Simon J. Gerraty ee7b0571c2 Merge head from 7/28 2014-08-19 06:50:54 +00:00
Julio Merino 3b70f97f92 Avoid name shadowing to fix build under powerpc64.
Error was:

cc1: warnings being treated as errors
.../usr.bin/m4/misc.c: In function 'm4errx':
.../usr.bin/m4/misc.c:268: warning: declaration of 'eval' shadows a global declaration
.../usr.bin/m4/extern.h:40: warning: shadowed declaration is here
2014-08-07 14:26:44 +00:00
Baptiste Daroussin d57779868c Lower warnings again to 3 the right thing would be to fix the warnings
which will be done by discussing with upstream I want the m4 code to stay
as close as possible to upstream.
2014-08-07 09:38:27 +00:00
Baptiste Daroussin e806d5088b Make libohash a proper internallib instead of hidding it in m4
mandoc development seems to be also using ohash so prepare to share the code when
needed
2014-08-06 22:46:15 +00:00
Baptiste Daroussin 88ce49a42a lower warning level to fix build with gcc 2014-07-31 05:56:15 +00:00
Joel Dahl 4a6ddb28cd mdoc: fix date. 2014-07-29 19:46:13 +00:00
Baptiste Daroussin 65a03bec27 Fix build with gcc 2014-07-29 09:46:08 +00:00
Baptiste Daroussin 18a8f7ea3b Remove ohash_int.h forgotten in previous commit 2014-07-27 22:56:46 +00:00
Baptiste Daroussin 88497f0c68 Sync with OpenBSD
This brings:
- check for integer overflows in custom allocs
- fix potential integer overflows in memory allocation
- annotate regexp error messages with source string
- better error handling in mkstemp/unlink/fdopen logic
2014-07-27 22:54:13 +00:00
Baptiste Daroussin 2b7af31cf5 use .Mt to mark up email addresses consistently (part3)
PR:		191174
Submitted by:	Franco Fichtner  <franco at lastsummer.de>
2014-06-23 08:23:05 +00:00
Simon J. Gerraty fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Simon J. Gerraty 76b28ad6ab Updated dependencies 2014-05-10 05:16:28 +00:00
Simon J. Gerraty cc3f4b9965 Merge from head 2014-05-08 23:54:15 +00:00
Warner Losh c6063d0da8 Use src.opts.mk in preference to bsd.own.mk except where we need stuff
from the latter.
2014-05-06 04:22:01 +00:00
Simon J. Gerraty 3b8f084595 Merge head 2014-04-28 07:50:45 +00:00
Julio Merino 3a92d97ff0 Migrate most of tools/regression/usr.bin/ to the new tests layout.
I'm starting with the easy cases.  The leftovers need to be looked at a
bit more closely.

Note that this change _does_ modify the code of the old tests.  This is
required in order to allow the code to locate the data files in the
source directory instead of the current directory, because Kyua
automatically changes the latter to a temporary directory.

Also note that at least one test is known to be broken here.  Actually,
the test is not really broken: it's marked as a TODO but unfortunately
Kyua's TAP parser currently does not understand that.  Will have to be
fixed separately.
2014-03-16 08:04:06 +00:00
Simon J. Gerraty d1d0158641 Merge from head 2013-09-05 20:18:59 +00:00
Joel Dahl 580dbd6574 mdoc: convert .Fd to .In, which is much nicer. 2013-06-04 07:37:06 +00:00
Jung-uk Kim 9c5a52cf88 Work around build breakages with GCC 4.2.
Reported by:	tinderbox
2013-05-23 05:42:35 +00:00
Jung-uk Kim 8ce3644c91 Reduce diff with upstream. 2013-05-03 23:29:38 +00:00
Ed Schouten 7e659f9491 Add the Clang specific -Wmissing-variable-declarations to WARNS=6.
This compiler flag enforces that that people either mark variables
static or use an external declarations for the variable, similar to how
-Wmissing-prototypes works for functions.

Due to the fact that Yacc/Lex generate code that cannot trivially be
changed to not warn because of this (lots of yy* variables), add a
NO_WMISSING_VARIABLE_DECLARATIONS that can be used to turn off this
specific compiler warning.

Announced on:	toolchain@
2013-04-19 19:45:00 +00:00
Simon J. Gerraty 7cf3a1c6b2 Updated dependencies 2013-03-11 17:21:52 +00:00
Simon J. Gerraty f5f7c05209 Updated dependencies 2013-02-16 01:23:54 +00:00
David E. O'Brien d9a447559b Sync with HEAD. 2013-02-08 16:10:16 +00:00
Antoine Brodin 6af2d8427c Add missing DPADD. 2013-01-01 18:25:14 +00:00
Simon J. Gerraty 23090366f7 Sync from head 2012-11-04 02:52:03 +00:00
Andreas Tobler 6f1a642726 Fix build. 2012-10-21 08:38:55 +00:00
Ed Schouten eccad22277 More -Wmissing-variable-declarations fixes.
In addition to adding missing `static' keywords:
- bin/dd: Pull in `extern.h' to guarantee consistency with source file.
- libexec/rpc.rusersd: Move shared globals into an extern.h.
- libexec/talkd: Move `debug' and `hostname' into extern.h.
- usr.bin/cksum: Put counters in extern.h, as they are used by ckdist/mtree.
- usr.bin/m4: Move `end_result' into extern.h.
- usr.sbin/services_mkdb: Move shared globals into an extern.h.
2012-10-20 10:33:15 +00:00
Joel Dahl aee53c332e Remove contractions. 2012-10-07 20:01:41 +00:00
Marcel Moolenaar 7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
Baptiste Daroussin 5e2a209a27 Fix world after byacc import:
- old yacc(1) use to magicially append stdlib.h, while new one don't
- new yacc(1) do declare yyparse by itself, fix redundant declaration of
  'yyparse'

Approved by:	des (mentor)
2012-05-22 16:33:10 +00:00
Baptiste Daroussin bdb6d17264 Respect mathematical operation order piority with the exponent gnu extension
Obtained from:	OpenBSD
Approved by:	des (mentor)
2012-04-30 21:02:57 +00:00
Baptiste Daroussin fb3f3d7caf Improve m4 compatibility with GNU m4 extension ** (exponent)
Submitted by:	Marc Espie (espie@OpenBSD.org)
Approved by:	des@ (mentor)
2012-04-15 13:25:51 +00:00
Ed Schouten 6b99842ada Globally replace u_int*_t from (non-contributed) man pages.
The reasoning behind this, is that if we are consistent in our
documentation about the uint*_t stuff, people will be less tempted to
write new code that uses the non-standard types.

I am not going to bump the man page dates, as these changes can be
considered style nits. The meaning of the man pages is unaffected.

MFC after:	1 month
2012-02-12 18:29:56 +00:00
Bjoern A. Zeeb 2cce1b69c4 Unbreak the build after r228697 adding the { } block to make clear which
if the else belongs to.
2011-12-19 08:50:17 +00:00
Dimitry Andric c48f7f6814 Repair breakage after r228697: since m4 now uses pow(3), it needs -lm.
Pointy hat to:	bapt
2011-12-18 23:54:32 +00:00
Baptiste Daroussin 4fff7a14ae Reimplement support for the ** (exponent) gnu extension, make it available thought the -g (mimic gnu) option
Reviewed by:	cognet
Approved by:	cognet
Discussed with:	espie@OpenBSD.org (upstream)
2011-12-18 22:04:55 +00:00
Baptiste Daroussin a841e1ebe6 Synchronize with laster version of m4 from OpenBSD and NetBSD
This bring better compatibility with gnum4

Reviewed by:	cognet
Approved by:	cognet
Obtained from:	OpenBSD, NetBSD
2011-11-28 13:32:39 +00:00
Ed Schouten df6dd6933d Mark global functions and/or variables in m4(1) static where possible.
This allows compilers and static analyzers to more thorough analysis.
2011-11-06 18:49:48 +00:00
Ed Schouten 1e2070ab5b Fix build of m4 with WARNS=6.
Change the parser; rename `exp' to `exponent' not to collide with exp(3).
2011-10-16 08:09:17 +00:00
Rebecca Cran 6bccea7c2b Fix typos - remove duplicate "the".
PR:	bin/154928
Submitted by:	Eitan Adler <lists at eitanadler.com>
MFC after: 	3 days
2011-02-21 09:01:34 +00:00
Joel Dahl da52b4caaf Remove the advertising clause from UCB copyrighted files in usr.bin. This
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change

Also add $FreeBSD$ to a few files to keep svn happy.

Discussed with:	imp, rwatson
2010-12-11 08:32:16 +00:00
Ed Schouten b7946da96b Build usr.bin/ with WARNS=6 by default.
Also add some missing $FreeBSD$ to keep svn happy.
2010-01-02 10:27:05 +00:00
Kevin Lo 8bcd62f2ff Use NULL instead of 0 for the return value of fopen().
Approved by: re (kensmith)
2007-09-21 01:55:11 +00:00
Ruslan Ermilov 254dd1666e Let bsd.prog.mk set SRCS and MAN to their default values. 2005-01-28 16:08:11 +00:00
Ruslan Ermilov a866e17077 Added the EXIT STATUS section where appropriate. 2005-01-17 07:44:44 +00:00
Tim J. Robbins f03b27517b Store a pointer to "null" in struct ndblock's defn member instead of a
duplicate allocated on the heap; the address defn points to is significant,
and is checked against the address of "null" in certain conditionals.

PR:		59883
MFC after:	1 week
2004-08-16 14:18:22 +00:00
Tim J. Robbins 338b72d96e Respect locale settings from the environment. 2004-07-12 02:48:40 +00:00
Tim J. Robbins 4f45d81178 Document missing multibyte character support in utilities specified
by POSIX.
2004-07-03 01:28:21 +00:00
Ruslan Ermilov 6a3e8b0adc Mechanically kill hard sentence breaks. 2004-07-02 22:22:35 +00:00
Stefan Farfeleder ec18ee18ad Don't depend on NULL's expansion being a pointer, cast it before it is passed
to variadic functions.

Approved by:	das (mentor)
2004-05-18 15:53:58 +00:00
Sean Kelly 42249c7f31 Fix m4 to properly handle bitwise operators &, ^, and |. Fix operator
precedence. Add short-circuit evaluation.

PR:		bin/60914
Reviewed by:	petef
Discussed with:	jeff, petef
2004-05-01 03:59:43 +00:00
Sean Kelly 15ea803975 m4 script to test the functionality of math operators in eval().
Submitted by:	K S Braunsdorf <sed@ksb.npcguild.org>
2004-05-01 03:27:05 +00:00
Maxim Konovalov 89dff38285 Use .St -susv2 rather than "The Single UNIX specification".
Submitted by:	osa
2003-12-10 10:52:48 +00:00
Philippe Charnier bfd62d7094 The .Nm utility 2003-06-08 13:47:20 +00:00
Tim J. Robbins aef4bb33e5 Flush streams before calling system() so that the output appears in the
right place in the output stream when redirected to a file (when full
buffering is enabled). Noticed by schweikh on freebsd-standards.
2003-05-01 02:36:27 +00:00
Jens Schweikhardt af16b40ba9 Correct typo in COMPATIBILITY section: s/esycmd/esyscmd 2003-04-23 08:47:51 +00:00
Jens Schweikhardt 57bd0fc6e8 english(4) police. 2002-12-27 12:15:40 +00:00
Juli Mallett 58896115b4 When we appear to want a signed value from sizeof(), use ssize_t in the cast,
rather than int.
2002-10-30 15:50:00 +00:00
Juli Mallett c624d24df3 Die on -D=foo, when parsing options - we can't let someone define (nil).
MFC after:	3 days
2002-09-04 01:12:39 +00:00
Juli Mallett 2c4acd2f49 Kill extraneous whitespace. 2002-07-15 02:15:12 +00:00
Juli Mallett 010b4b09f1 Add a default case to the getopt(3) switch, remove a blank line nearby. 2002-07-14 02:34:37 +00:00
Juli Mallett d1fea89cae Functions declared as <type> <identifier>(<nil>) should be declared as
<type> <identifier>(<void-type>) in ANSI C.
2002-07-14 02:03:23 +00:00
Juli Mallett 7b6f658ced Remove prototype for main(). 2002-07-14 02:00:45 +00:00
Juli Mallett 701e9a0054 Whitespace fixes to line-up EOL escapes whose right-most extraints changed in
the previous revision due to the biggest line changing.
2002-06-20 11:17:46 +00:00
Juli Mallett d40d348ceb Cast sp to uintptr_t when doing a compare of it to STACKMAX which is a size_t.
This messes up some indentation in mdef.h for some macros.
2002-06-20 11:14:54 +00:00
Juli Mallett 6fc8ba94c6 Note that this appeared at least as early as PWB UNIX.
Use the literal string 'PWB UNIX', as we still have no .At macro for it.
2002-06-10 22:59:59 +00:00
Juli Mallett ee3cbef6be Make the manpage consistent with the code on the subject of comments, as to
not change the code to always do the "GNU" thing, as it's possible people
rely on BSD m4(1) traditionally resetting comment characters in case of no
arguments to the changecom function.

PR:	bin/17480 (I think this satisfies the problem report)
2002-06-03 20:35:35 +00:00
Ruslan Ermilov 39a82b8c2d mdoc(7) police: tidy up the markup. 2002-05-30 11:12:34 +00:00
Tim J. Robbins 7d44cb6e1f Add Standards, Diagnostics and History sections. 2002-05-26 07:07:14 +00:00
Tim J. Robbins 456fc9e56f If a file operand cannot be processed, go on to process any remaining files
but exit non-zero.
2002-05-26 06:15:15 +00:00
Juli Mallett a1269e01b8 Rename eqrelval' which was renamed from eqrel' to quiet a shadow warning
to `op' as suggested by Bruce, as this is used to store the operator between
vl and vr.

Submitted by:	bde
2002-05-03 20:46:10 +00:00
Juli Mallett 90432ef88d Revert vendor identifiers, and #if 0 what is #if 0/#else for OpenBSD.
Add __FBSDID() properly.

Requested by:	bde, mike
2002-05-03 14:48:21 +00:00
Juli Mallett 8f12fc049c Remove redundant declarations of getopt(3) externals (since <unistd.h> does
take care of them), and add __FreeBSD__ to the defined() checks for the
_PATH_DIVNAME.
2002-05-02 05:25:23 +00:00
Juli Mallett 26849aba03 Add some spurious veritcal whitespace to reduce diffs to OpenBSD. 2002-05-01 21:45:22 +00:00
Juli Mallett bd2bfb5846 Merge local changes again, against ANSIfied m4(1). 2002-05-01 21:37:29 +00:00
Juli Mallett 82130df48c Use %zu to print a size_t, not %u and definitely not %d.
Remove WARNS?=2, as GCC will usually throw a fit right now, and I'm not going
to mix WARNS and NO_WERROR.

Submitted by:	fenner
2002-04-20 21:37:26 +00:00
Juli Mallett 815bee2f7b Print a size_t as %u not %d.
Pointed out by:	mike, des's tinderbox
2002-04-20 21:13:00 +00:00
Philippe Charnier e8937ba009 Use `The .Nm utility' 2002-04-20 12:18:28 +00:00
Andrey A. Chernov a2f7d5dc07 Prevent sign extension (again) 2002-04-20 02:04:58 +00:00
Juli Mallett ccc5b4e6f4 Crank WARNS.
Cast sizeof() to (int), as it's being compared against an int, not a size_t.
If i is changed to a size_t, it means the logic must be slightly changed later
in the flow, where --i is checked to be >= 0.  I am not sure I want to make a
logic change to account for clearing up a warning, when an aesthetic one will
keep from modifying the logic.

Other harmless casts, that I think I've made in the right directions.

Make gpbc() an inline function, rather than an obfuscated macro, make its
scratch space local, rather than global.  The previous macro used a dirty
hack (logical AND in place of a conditional) which would lead GCC to throw
a fit (rightly so) as the logical check, as well as the incrementation of
a variable, were not used for anything.

const'ify a few places where gcc3 yells. xstrdup() some global consts in
places where we xstrdup() when not using consts, but tried to assign them
to non-consts before.

Don't use execv(2) if we don't have the kind of arguments it wants.

Reviewed by:    asmodai obrien tjr
Submitted by:   tjr (a gcc3 build log)
2002-04-20 01:49:10 +00:00
Andrey A. Chernov 81153b6b63 Prevent sign extension on characters with 8bit set 2002-04-19 19:43:46 +00:00
Juli Mallett 56ca2b35a4 Add __FBSDID, this file was unmodified so it was missed in the initial sweep. 2002-04-19 17:33:12 +00:00
Juli Mallett acc9d40838 Bring OpenBSD m4(1) off of the OPENBSD vendor branch, and add the -s option,
$FreeBSD$ identifiers, and fix initialisation to stderr to happen in a function
as stderr is not the same in CURRENT as in OpenBSD.

Reviewed by:	obrien
2002-04-19 17:26:21 +00:00
Juli Mallett 29fc00b3fb Merge differences and correct the manual page. 2002-04-19 17:16:23 +00:00
Juli Mallett b1ea3d46b7 This adds support for -s to the m4(1) utility, which causes #line directives
to be emitted as per the C preprocessor.  It updates the manual page in
regards to standards accordingly.

PR:		standards/36075
Submitted by:	tjr
Reviewed by:	mike
MFC after:	1 week
2002-04-17 17:26:32 +00:00
Warner Losh d3cb5ded92 remove __P 2002-03-22 01:33:25 +00:00
Juli Mallett 8a998f1ea1 This commit was generated by cvs2svn to compensate for changes in r90744,
which included commits to RCS files with non-trunk default branches.
2002-02-16 21:27:48 +00:00
Juli Mallett e3d8671772 Import OpenBSD m4 as of today. 2002-02-16 21:27:48 +00:00
Juli Mallett d1bbdb91ad Import OpenBSD m4 as of today. 2001-11-16 23:50:40 +00:00
Juli Mallett add74ed370 Import OpenBSD m4 as of today. 2001-09-27 11:40:33 +00:00
Juli Mallett e98bffde50 Import OpenBSD m4 as of today. 2001-09-18 14:55:52 +00:00
David E. O'Brien de9b3b9034 Remove the local basename in favor of the libc version.
Remove xmalloc and xstrdup and do the error checking at the place of use.
2001-07-24 14:09:47 +00:00
Dima Dorfman f247324df7 Remove whitespace at EOL. 2001-07-15 08:06:20 +00:00
Gregory Neil Shapiro 1d3ebaf302 Make sure the len() builtin always returns an answer. Previously,
len(`') didn't return an answer.  Now it returns 0.

PR:		bin/12942
MFC after:	5 days
2001-05-29 03:32:38 +00:00
Gregory Neil Shapiro 4ba4d3873a String operations could silently truncate long strings, leaving the output
corrupted.  Mark's patch fixes this be removing the MAXTOK limitation on
substring operations and allowing the putback buffer size to be the limiting
factor.  If the putback buffer size if reached, m4 gives an error instead of
silently truncating the string.

PR:		bin/26619
Submitted by:	Mark Peek <mark-ml@whistle.com>
MFC after:	5 days
2001-05-18 18:35:34 +00:00
Gregory Neil Shapiro 164c01f05b Clean up temporary file(s) and directory when m4 exits without falling
through main() (e.g., signals or calls to errx()).

PR:		conf/25715
2001-04-16 18:36:35 +00:00