Commit Graph

69 Commits

Author SHA1 Message Date
tsutsui e371117863 Make build with WARNS=5. 2022-09-03 07:45:08 +00:00
mrg de11d87641 introduce some common variables for use in GCC warning disables:
GCC_NO_FORMAT_TRUNCATION    -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION  -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW    -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE   -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints.  many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
2019-10-13 07:28:04 +00:00
sevan 421949a31f ansify - drop the K&R style prototypes & implementations. 2018-01-23 21:06:24 +00:00
sevan f7a3540ecf Drop main() prototype. 2017-05-04 16:26:09 +00:00
skrll 6d3ceb1d61 Rename NetBSD/hp700 to NetBSD/hppa.
Unfortunately our VCS isn't very helpful here.
2014-02-24 07:23:38 +00:00
joerg 9edf9a0457 Remove many HAVE_GCC || HAVE_PCC conditionals as the options also apply
to Clang. Add a few cases of HAVE_LLVM for -fno-strict-aliasing.
2012-08-10 12:10:27 +00:00
tsutsui e653c834ec Remove nonexistent (probably HP-UX specific) Xref rmp(4). 2011-12-15 16:45:21 +00:00
joerg bec77c5f43 Use __dead 2011-08-31 13:32:36 +00:00
mrg 75e42fa7da remove most of the remaining HAVE_GCC tests that are always true in
the modern world.
2011-06-20 07:43:56 +00:00
joerg ea580acd89 Use proper format string 2011-05-24 13:19:55 +00:00
rmind bb9ae7c0c2 Restore historic SCCS IDs in the comments (were removed in previous commit).
Noted by wiz@.
2011-02-09 10:25:40 +00:00
rmind 9b6bd2d968 Remove clause 3 (UCB advertising clause) from the University of Utah
copyright.  Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
2011-02-08 20:20:06 +00:00
lukem 178a598d18 Fix WARNS=4 issues (-Wsign-compare -Wcast-qual) 2009-04-18 09:18:17 +00:00
gmcgarry 3c9a95916d Wrap compiler-specific flags with HAVE_GCC and HAVE_PCC as necessary. Add a few flags for PCC. 2008-08-29 00:02:21 +00:00
lukem 9c1945664c Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
2008-07-21 13:36:57 +00:00
tls 4147a3c54a Add new Makefile knob, USE_FORT, which extends USE_SSP by turning on the
FORTIFY_SOURCE feature of libssp, thus checking the size of arguments to
various string and memory copy and set functions (as well as a few system
calls and other miscellany) where known at function entry.  RedHat has
evidently built all "core system packages" with this option for some time.

This option should be used at the top of Makefiles (or Makefile.inc where
this is used for subdirectories) but after any setting of LIB.

This is only useful for userland code, and cannot be used in libc or in
any code which includes the libc internals, because it overrides certain
libc functions with macros.  Some effort has been made to make USE_FORT=yes
work correctly for a full-system build by having the bsd.sys.mk logic
disable the feature where it should not be used (libc, libssp iteself,
the kernel) but no attempt has been made to build the entire system with
USE_FORT and doing so will doubtless expose numerous bugs and misfeatures.

Adjust the system build so that all programs and libraries that are setuid,
directly handle network data (including serial comm data), perform
authentication, or appear likely to have (or have a history of having)
data-driven bugs (e.g. file(1)) are built with USE_FORT=yes by default,
with the exception of libc, which cannot use USE_FORT and thus uses
only USE_SSP by default.  Tested on i386 with no ill results; USE_FORT=no
per-directory or in a system build will disable if desired.
2007-05-28 12:06:17 +00:00
hubertf 5873860993 - Removed unused ctype.h header
- ANSI'fy
  - Removed __P() macros

From: Slava Semushin <slava.semushin@gmail.com>
2007-02-21 20:57:55 +00:00
mrg 8f1fc6cc86 use -fno-strict-aliasing for utils.c with GCC4 2006-05-11 07:19:33 +00:00
snj a640fe8c43 It's "its." 2006-04-24 19:00:29 +00:00
christos 70ab7c8528 Mention cloning device. 2004-12-01 23:16:02 +00:00
christos fb5ec6aa33 Use cloning /dev/bpf 2004-12-01 23:13:09 +00:00
dsl e2f49bd9e2 Add (unsigned char) cast to ctype functions 2004-10-30 15:15:37 +00:00
mycroft 20e25f9518 Fix portability problems, per PR 5783. 2004-07-06 13:05:25 +00:00
darrenr 221fa57241 With recent changes to BPF, pushing the default buffer size to 1MB, running
a bunch of small daemons that seem small packet flows can easily chew up
significant kernel memory (each BPF device opened takes 2*buffersize of
wired memory.)  In each of these applications, add code to set the buffer
size to 32k before setting the interface.
2004-04-10 17:53:05 +00:00
itojun 7f5c6fbfb1 use strlcpy 2003-08-19 22:22:27 +00:00
agc 326b2259b7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22366, verified by myself.
2003-08-07 11:25:11 +00:00
itojun 7bb0ef551c use bounded string op 2003-07-13 12:18:55 +00:00
itojun d25769c013 assume presense of getifaddrs(3). 2003-05-15 14:50:02 +00:00
mycroft aae6c28cf9 null commit 2002-09-23 12:44:34 +00:00
itojun f46e921837 poll.h, not sys/poll.h 2002-09-23 03:36:03 +00:00
mycroft fbf6498012 select() -> poll() 2002-09-19 03:04:13 +00:00
grant eda9e509bb sweep of errx/warnx, remove unnecessary trailing \n 2002-07-20 08:40:16 +00:00
scottr 6cd097bc12 Pack the RMP packet layout definitions -- with ELF, 32-bit words
are by default aligned on 32-bit boundaries. Update a semi-related
comment with this info.
2002-05-14 04:58:56 +00:00
wiz 65d97d1e55 Improve markup, unquote header. 2002-02-02 01:40:52 +00:00
cgd 25bdbb661e convert to use getprogname() 2001-02-19 23:22:40 +00:00
lukem 9b7718e15b set *errmsg to errbuf, preventing coredump if no interfaces are up 2001-02-05 02:37:34 +00:00
cgd 9cfe468c74 avoid C sequence point issues warned about by development version of gcc. 2001-01-16 02:41:17 +00:00
cgd ede451d831 comment about the backslash used to avoid trigraph 2001-01-16 02:36:29 +00:00
lukem 13220245b2 use explicit name rather than __progname in openlog 2001-01-11 01:43:25 +00:00
cgd 94e108c80f avoid accidental use of ANSI C trigraphs. 2000-12-20 01:30:26 +00:00
is d8302e2d73 More format string cleanups by sommerfeld. 2000-10-11 20:23:46 +00:00
itojun e9c5139f22 use getifaddrs, not SIOCGIFCONF. (should use pcap_lookupdev instead...) 2000-04-13 08:52:44 +00:00
kleink a3c6c197a2 Cast timeval members to types we know the printf conversions of. 2000-03-27 17:03:25 +00:00
thorpej 56c5efa335 Use pidfile(3). 1999-06-06 02:52:16 +00:00
bouyer 938264f6ee If the client doesn't supply a filename, give it back the first one listed
for this station instead of an error. This is required for hp700 machines.
1999-02-01 17:00:44 +00:00
mrg fdca644f9d - fix typo in a comment
- use the last connection RMPCONN cache correctly, and do not leak
  memory for each connection.
1998-12-09 03:41:42 +00:00
mrg 32f519716b - use an array MAXHOSTNAMELEN+1 size to hold hostnames
- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames
1998-07-06 06:56:06 +00:00
mycroft e8018f6da9 Use S_IS*(), not S_IF*. 1997-10-19 19:40:21 +00:00
lukem 7f43427b52 use strchr/strrchr/memset/memmove instead of index/rindex/bzero/bcopy 1997-10-18 11:23:20 +00:00
lukem dd30ff553b use strchr/strrchr/memset/memmove instead of index/rindex/bzero/bcopy 1997-10-18 11:23:03 +00:00