Commit Graph

29 Commits

Author SHA1 Message Date
lukem f937c412f3 bsd.own.mk: rename to CC_WNO_ADDRESS_OF_PACKED_MEMBER
Provide a single variable
	CC_WNO_ADDRESS_OF_PACKED_MEMBER
with options for both clang and gcc, to replace
	CLANG_NO_ADDR_OF_PACKED_MEMBER
	CC_NO_ADDR_OF_PACKED_MEMBER
	GCC_NO_ADDR_OF_PACKED_MEMBER

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
2023-06-03 08:52:53 +00:00
nia 1ef2e3bf13 ndbootd(8): Rework allocation macros to add integer overflow checking. 2021-10-30 10:44:25 +00:00
mrg cb93b81028 add support for new GCC 9 warnings that may be too much to fix
right now.  new address-of-packed-member and format-overflow
warnings have new GCC_NO_ADDR_OF_PACKED_MEMBER amd
GCC_NO_FORMAT_OVERFLOW variables to remove these warnings.

apply to a bunch of the tree.  mostly, these are real bugs that
should be fixed, but in many cases, only by removing the 'packed'
attribute from some structure that doesn't really need it.  (i
looked at many different ones, and while perhaps 60-80% were
already properly aligned, it wasn't clear to me that the uses
were always coming from sane data vs network alignment, so it
doesn't seem safe to remove packed without careful research for
each affect struct.)  clang already warned (and was not erroring)
for many of these cases, but gcc picked up dozens more.
2020-09-06 07:20:26 +00:00
joerg a216da57a6 Default to -Wno-sign-compare -Wno-pointer-sign for clang.
Push -Wno-array-bounds down to the cases that depend on it.
Selectively disable warnings for 3rd party software or non-trivial
issues to be reviewed later to get clang -Werror to build most of the
tree.
2011-05-26 12:56:24 +00:00
lukem d877c4c3c0 Enable WARNS=4 by default, except for:
cpuctl  dumplfs  hprop  ipf  iprop-log  kadmin  kcm  kdc  kdigest
	kimpersonate  kstash  ktutil  makefs  ndbootd  ntp  pppd  quot
	racoon  racoonctl  rtadvd  sntp  sup  tcpdchk  tcpdmatch  tcpdump
	traceroute  traceroute6  user  veriexecgen  wsmoused  zic
(Mostly third-party applications)
2009-04-22 15:23:01 +00:00
tsutsui c007028e0b Enable gcc optimization on m68000 (sun2) again with minimum hacks.
gcc -O0 generates a bit fat binaries.
2008-04-27 03:06:46 +00:00
mrg ecc90aa046 make all sun2 use -O0 and move most of the hacks out into just 3 files. 2008-02-09 02:37:21 +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
scw cf78539af7 Undo a workaround for an old SH5 toolchain bug.
No functional change.
2007-04-08 09:43:51 +00:00
mrg 9bf1d4a9b8 work around some GCC4 internal problems on m68000 platform.
document the hack, and update another GCC4 list.
2006-06-24 05:21:11 +00:00
christos 64274c3774 Coverity CID 754: Fix erroneous check. How could this ever work? 2006-05-25 01:18:59 +00:00
lukem 616bb5ee8e appease gcc -Wuninitialized 2005-06-02 11:29:01 +00:00
lukem 274427706d Rewrite method used to determine the ethernet address of the desired
interface to not use uninitalized variables.
Bug crept in in conversion to getifaddrs().
Detected with gcc -Wuninitalized.
2005-06-02 11:27:44 +00:00
christos ce1320fc34 use cloning bpf. 2004-12-01 23:18:20 +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
wiz 0d0f4c1fdd Fix MAX macro; from Jeff Ito in PR 24008. 2004-01-06 23:02:55 +00:00
itojun 916585ff14 SIOCGIFCONF->getifaddrs conversion 2003-08-17 22:34:17 +00:00
itojun af8ebb34e7 use snprintf 2003-07-15 12:32:07 +00:00
mycroft 05abee23d9 select() -> poll(), nanosleep() 2002-09-19 16:45:57 +00:00
scw 046bb1fbbc Work-around an internal compiler error on the SuperH sh5 toolchain. 2002-07-11 19:47:17 +00:00
thorpej 2597d53f5a Use __RCSID(). 2002-04-09 02:35:31 +00:00
wiz 73d8bdb949 Drop a superfluous .Pp. 2002-02-02 01:21:00 +00:00
wiz a2d753e3ef Whitespace nits. 2002-01-19 11:44:57 +00:00
fredette fd8d9e615b Merge in ndbootd-0.5. 2001-06-13 21:38:30 +00:00
fredette 74cc4fdaac Import of Matt Fredette's ndbootd-0.5 boot program for Sun2 machines. 2001-06-13 21:35:57 +00:00
fredette 735202e79f Merge in ndbootd-0.4. 2001-05-23 02:59:35 +00:00
fredette bbf2feac6e Import of Matt Fredette's ndbootd boot program for Sun2 machines. 2001-05-23 02:49:37 +00:00
fredette ab467667c7 Finished the 3rdparty import procedure for the ndbootd
package: Added RCS IDs, a Makefile, added to 3RDPARTY.
Also removed sunndd from 3RDPARTY.
2001-05-22 14:41:59 +00:00
fredette 2d0f1618a6 Import of Matt Fredette's ndbootd boot program for Sun2 machines. 2001-05-22 14:20:49 +00:00