History log of /freebsd-11-stable/usr.bin/m4/main.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 352281 13-Sep-2019 bapt

MFC r352065-r352070

Sync with OpenBSD, in particular this adds support for -E flags
(GNU compatibility)


# 331722 29-Mar-2018 eadler

Revert r330897:

This was intended to be a non-functional change. It wasn't. The commit
message was thus wrong. In addition it broke arm, and merged crypto
related code.

Revert with prejudice.

This revert skips files touched in r316370 since that commit was since
MFCed. This revert also skips files that require $FreeBSD$ property
changes.

Thank you to those who helped me get out of this mess including but not
limited to gonzo, kevans, rgrimes.

Requested by: gjb (re)


# 330897 14-Mar-2018 eadler

Partial merge of the SPDX changes

These changes are incomplete but are making it difficult
to determine what other changes can/should be merged.

No objections from: pfg


# 302408 07-Jul-2016 gjb

Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle.
Prune svn:mergeinfo from the new branch, as nothing has been merged
here.

Additional commits post-branch will follow.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


/freebsd-11-stable/MAINTAINERS
/freebsd-11-stable/cddl
/freebsd-11-stable/cddl/contrib/opensolaris
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/zfs
/freebsd-11-stable/cddl/contrib/opensolaris/lib/libzfs
/freebsd-11-stable/contrib/amd
/freebsd-11-stable/contrib/apr
/freebsd-11-stable/contrib/apr-util
/freebsd-11-stable/contrib/atf
/freebsd-11-stable/contrib/binutils
/freebsd-11-stable/contrib/bmake
/freebsd-11-stable/contrib/byacc
/freebsd-11-stable/contrib/bzip2
/freebsd-11-stable/contrib/com_err
/freebsd-11-stable/contrib/compiler-rt
/freebsd-11-stable/contrib/dialog
/freebsd-11-stable/contrib/dma
/freebsd-11-stable/contrib/dtc
/freebsd-11-stable/contrib/ee
/freebsd-11-stable/contrib/elftoolchain
/freebsd-11-stable/contrib/elftoolchain/ar
/freebsd-11-stable/contrib/elftoolchain/brandelf
/freebsd-11-stable/contrib/elftoolchain/elfdump
/freebsd-11-stable/contrib/expat
/freebsd-11-stable/contrib/file
/freebsd-11-stable/contrib/gcc
/freebsd-11-stable/contrib/gcclibs/libgomp
/freebsd-11-stable/contrib/gdb
/freebsd-11-stable/contrib/gdtoa
/freebsd-11-stable/contrib/groff
/freebsd-11-stable/contrib/ipfilter
/freebsd-11-stable/contrib/ldns
/freebsd-11-stable/contrib/ldns-host
/freebsd-11-stable/contrib/less
/freebsd-11-stable/contrib/libarchive
/freebsd-11-stable/contrib/libarchive/cpio
/freebsd-11-stable/contrib/libarchive/libarchive
/freebsd-11-stable/contrib/libarchive/libarchive_fe
/freebsd-11-stable/contrib/libarchive/tar
/freebsd-11-stable/contrib/libc++
/freebsd-11-stable/contrib/libc-vis
/freebsd-11-stable/contrib/libcxxrt
/freebsd-11-stable/contrib/libexecinfo
/freebsd-11-stable/contrib/libpcap
/freebsd-11-stable/contrib/libstdc++
/freebsd-11-stable/contrib/libucl
/freebsd-11-stable/contrib/libxo
/freebsd-11-stable/contrib/llvm
/freebsd-11-stable/contrib/llvm/projects/libunwind
/freebsd-11-stable/contrib/llvm/tools/clang
/freebsd-11-stable/contrib/llvm/tools/lldb
/freebsd-11-stable/contrib/llvm/tools/llvm-dwarfdump
/freebsd-11-stable/contrib/llvm/tools/llvm-lto
/freebsd-11-stable/contrib/mdocml
/freebsd-11-stable/contrib/mtree
/freebsd-11-stable/contrib/ncurses
/freebsd-11-stable/contrib/netcat
/freebsd-11-stable/contrib/ntp
/freebsd-11-stable/contrib/nvi
/freebsd-11-stable/contrib/one-true-awk
/freebsd-11-stable/contrib/openbsm
/freebsd-11-stable/contrib/openpam
/freebsd-11-stable/contrib/openresolv
/freebsd-11-stable/contrib/pf
/freebsd-11-stable/contrib/sendmail
/freebsd-11-stable/contrib/serf
/freebsd-11-stable/contrib/sqlite3
/freebsd-11-stable/contrib/subversion
/freebsd-11-stable/contrib/tcpdump
/freebsd-11-stable/contrib/tcsh
/freebsd-11-stable/contrib/tnftp
/freebsd-11-stable/contrib/top
/freebsd-11-stable/contrib/top/install-sh
/freebsd-11-stable/contrib/tzcode/stdtime
/freebsd-11-stable/contrib/tzcode/zic
/freebsd-11-stable/contrib/tzdata
/freebsd-11-stable/contrib/unbound
/freebsd-11-stable/contrib/vis
/freebsd-11-stable/contrib/wpa
/freebsd-11-stable/contrib/xz
/freebsd-11-stable/crypto/heimdal
/freebsd-11-stable/crypto/openssh
/freebsd-11-stable/crypto/openssl
/freebsd-11-stable/gnu/lib
/freebsd-11-stable/gnu/usr.bin/binutils
/freebsd-11-stable/gnu/usr.bin/cc/cc_tools
/freebsd-11-stable/gnu/usr.bin/gdb
/freebsd-11-stable/lib/libc/locale/ascii.c
/freebsd-11-stable/sys/cddl/contrib/opensolaris
/freebsd-11-stable/sys/contrib/dev/acpica
/freebsd-11-stable/sys/contrib/ipfilter
/freebsd-11-stable/sys/contrib/libfdt
/freebsd-11-stable/sys/contrib/octeon-sdk
/freebsd-11-stable/sys/contrib/x86emu
/freebsd-11-stable/sys/contrib/xz-embedded
/freebsd-11-stable/usr.sbin/bhyve/atkbdc.h
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.c
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.h
/freebsd-11-stable/usr.sbin/bhyve/console.c
/freebsd-11-stable/usr.sbin/bhyve/console.h
/freebsd-11-stable/usr.sbin/bhyve/pci_fbuf.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.h
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.c
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.h
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.c
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.h
/freebsd-11-stable/usr.sbin/bhyve/rfb.c
/freebsd-11-stable/usr.sbin/bhyve/rfb.h
/freebsd-11-stable/usr.sbin/bhyve/sockstream.c
/freebsd-11-stable/usr.sbin/bhyve/sockstream.h
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.c
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.h
/freebsd-11-stable/usr.sbin/bhyve/usb_mouse.c
/freebsd-11-stable/usr.sbin/bhyve/vga.c
/freebsd-11-stable/usr.sbin/bhyve/vga.h
# 291128 21-Nov-2015 bapt

Synchronize m4(1) with OpenBSD


# 283089 18-May-2015 bapt

Synchronize with OpenBSD

Obtained from: OpenBSD


# 269162 27-Jul-2014 bapt

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


# 250226 03-May-2013 jkim

Reduce diff with upstream.


# 241777 20-Oct-2012 ed

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.


# 234310 15-Apr-2012 bapt

Improve m4 compatibility with GNU m4 extension ** (exponent)

Submitted by: Marc Espie (espie@OpenBSD.org)
Approved by: des@ (mentor)


# 228063 28-Nov-2011 bapt

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


# 227241 06-Nov-2011 ed

Mark global functions and/or variables in m4(1) static where possible.

This allows compilers and static analyzers to more thorough analysis.


# 226422 16-Oct-2011 ed

Fix build of m4 with WARNS=6.

Change the parser; rename `exp' to `exponent' not to collide with exp(3).


# 216370 11-Dec-2010 joel

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


# 133858 16-Aug-2004 tjr

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


# 132004 12-Jul-2004 tjr

Respect locale settings from the environment.


# 102917 03-Sep-2002 jmallett

Die on -D=foo, when parsing options - we can't let someone define (nil).

MFC after: 3 days


# 100014 15-Jul-2002 jmallett

Kill extraneous whitespace.


# 99941 14-Jul-2002 jmallett

Add a default case to the getopt(3) switch, remove a blank line nearby.


# 99939 14-Jul-2002 jmallett

Functions declared as <type> <identifier>(<nil>) should be declared as
<type> <identifier>(<void-type>) in ANSI C.


# 99938 14-Jul-2002 jmallett

Remove prototype for main().


# 98490 20-Jun-2002 jmallett

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.


# 97296 26-May-2002 tjr

If a file operand cannot be processed, go on to process any remaining files
but exit non-zero.


# 95982 03-May-2002 jmallett

Revert vendor identifiers, and #if 0 what is #if 0/#else for OpenBSD.

Add __FBSDID() properly.

Requested by: bde, mike


# 95918 02-May-2002 jmallett

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.


# 95887 01-May-2002 jmallett

Merge local changes again, against ANSIfied m4(1).


# 95095 19-Apr-2002 jmallett

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)


# 95060 19-Apr-2002 jmallett

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


# 94957 17-Apr-2002 jmallett

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


# 80289 24-Jul-2001 obrien

Remove the local basename in favor of the libc version.
Remove xmalloc and xstrdup and do the error checking at the place of use.


# 75551 16-Apr-2001 gshapiro

Clean up temporary file(s) and directory when m4 exits without falling
through main() (e.g., signals or calls to errx()).

PR: conf/25715


# 73240 28-Feb-2001 jhay

The secure temporary directory is always created, so always remove it.


# 69030 22-Nov-2000 kris

Create temporary files in a secure directory, instead of using multiple
filenames based on a single invocation of mktemp() in /tmp, which is
easily predictable after the first one.

Audited by: markm


# 65428 04-Sep-2000 imp

getopt and friends are declared in <unistd.h>
getopt returns -1 not EOF.


# 50477 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 27625 23-Jul-1997 charnier

Use err(3) instead of local redefinition. Remove progname.


# 24360 29-Mar-1997 imp

compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


# 8874 30-May-1995 rgrimes

Remove trailing whitespace.


# 5165 18-Dec-1994 ache

Make m4 more 8bit clean.
Don't use is*(EOF)
This fix core dump when LANG setted to 8bit wide charset
and ENABLE_STARTUP_LOCALE


# 1591 27-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1590,
which included commits to RCS files with non-trunk default branches.


# 1590 27-May-1994 rgrimes

BSD 4.4 Lite Usr.bin Sources