Commit Graph

100 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
andvar e1541cea4e s/reqest/request/, s/requst/request/ and s/reuqest/request/ in comments. 2022-12-24 15:23:02 +00:00
rillig 6c259f3957 fix misspellings of 'available' and nearby typos 2022-09-10 12:14:17 +00:00
andvar 1cb7819f04 fix various typos in comments. 2021-12-12 22:20:52 +00:00
msaitoh 54914f4034 s/streror/strerror/ in comment. 2021-11-10 15:49:42 +00:00
joerg 67de9e3b2a address-of-packed-member warning is no longer a problem here. 2021-05-30 02:28:35 +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
mrg fbffadb9f8 - add or adjust /* FALLTHROUGH */ where appropriate
- add __unreachable() after functions that can return but won't in
  this case, and thus can't be marked __dead easily
2019-02-03 03:19:25 +00:00
dholland 32cded6cc9 Typos. 2018-02-08 09:05:16 +00:00
wiz 01869ca4d2 Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
sevan f7a3540ecf Drop main() prototype. 2017-05-04 16:26:09 +00:00
joerg f9c2736326 Disable a couple of warnings until further investigation. 2017-01-11 12:19:43 +00:00
joerg 8ef27f1e3d Avoid access to unaligned data. 2017-01-11 12:18:22 +00:00
joerg d101c0e239 Fix syntax (hi apb!) 2014-03-29 22:45:31 +00:00
apb a88920f53c sizeof(pointer) is not a good buffer length to pass to strlcat.
Introduce a new variable, clntpathmaxlen, to hold the correct
buffer length, and pass that to strlcat.

The incorrect buffer length would have caused <filename>.<hostname>
lookups to fail.
2014-03-29 18:23:00 +00:00
christos 0a77b69ab6 fix unused variable warnings. 2013-10-19 17:16:37 +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
roy 258cf0abec Add capfile(5) to describe the termcap format.
Adjust various man pages and other documentation to point to capfile(5)
instead of termcap(5).
Remove getcap(3) as curses hasn't been building it for a long time.
Punt wrterm.c as tset no longer uses it.
2012-04-21 12:27:24 +00:00
joerg 32ffffe1af Fix under-allocation-by-one 2011-10-07 10:06:39 +00:00
joerg dccf569e0e Use __dead. 2011-08-29 20:38:53 +00:00
christos 93bbed154f use const char [] for format 2011-08-21 08:59:50 +00:00
christos 6f0b276b18 fix non-literal strings 2011-08-16 08:02:18 +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
wiz 7e975aaf96 Add missing breaks in switch statement. Found by cppcheck. 2011-01-04 09:16:17 +00:00
lukem 7affd6558f Fix -Wsign-compare issues 2009-04-15 00:13:50 +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 66176dfdff Rename MKPRIVATELIB to LIBISPRIVATE, to make it clearer that this is
a variable that is used by in-tree Makefiles to control behaviour.
(MKsomevar variables are generally intended to be controlled by the end-user)
2008-05-03 14:48:30 +00:00
xtraeme c8f61d2b50 WARNS=4 2008-05-02 19:22:10 +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
tls be45f4d02a For FORTIFY_SOURCE: do not pretend to convert code from b* to mem* by
using a #define to turn one into the other, this is pointless and causes
more portability issues than it solves (admittedly, in the year 1702 when
this code was written the opposite may have been the case).
2007-05-27 16:31:41 +00:00
msaitoh 8ce1f4fff2 fix typos 2007-04-29 20:23:34 +00:00
hubertf e4dc235f82 - Remove unused ctype.h header
- Remove unused debug and progname variables
 - Use return instead of exit() for quiting at end of main()
 - Print errors to stderr instead of stdout

From: Slava Semushin <php-coder@altlinux.ru>
2007-03-10 00:16:51 +00:00
reed 5fe28dc7e5 Fix typo or mispelling. 2006-06-17 04:58:14 +00:00
christos 1dc235cd39 Coverity CID 2448: Remove extra NULL check. 2006-05-23 01:29:31 +00:00
mrg aadd7d4847 sprinkle some -fno-strict-aliasing and -Wno-pointer-sign with GCC4. 2006-05-11 23:16:28 +00:00
mrg 0c37c63edc change (mostly) int to socklen_t. GCC 4 doesn't like that int and
socklen_t are different signness.
2006-05-09 20:18:05 +00:00
wiz 5d1e8b2745 Fix some typos. 2006-02-25 02:28:55 +00:00
hira c79d0a54ae usage: Add -f and -m. Use getprogname(). Print to strerr.
Reviewed by uebayasi@.  This closes PR bin/26535.
2004-11-17 13:28:31 +00:00
hira 75febfe0c8 usage: Print program name. Whitespace nit.
Reviewed by uebayasi@.  This closes PR bin/26534.
2004-11-17 13:21:09 +00:00
dsl e09553f3ac Add (unsigned char) cast to ctype functions 2004-10-29 20:33:06 +00:00
lukem b817247988 Use MKPRIVATELIB=yes instead of providing an empty libinstall:: target and
setting NOLINT, NOPIC, NOPROFILE (etc)
2004-05-23 02:24:50 +00:00
itojun 757e458559 SIOCGIFCONF -> getifaddrs conversion 2003-08-18 05:39:52 +00:00
itojun 47a6a58fe5 use bounded string op 2003-07-14 08:36:34 +00:00
itojun 5402d14cf4 use boundedd string ops 2003-07-14 06:08:04 +00:00
itojun 89bf339ad7 use strlcpy/strlcat 2003-05-17 20:58:39 +00:00
wiz cd68fb44fb guarantee, not guarentee. Idea from miod@openbsd. 2003-02-02 10:24:38 +00:00
wiz 7bd6fd354d unknown, not unkown. Noted by mjl. 2003-01-28 22:19:22 +00:00
wiz c053751628 compatibility, not compatiblity. 2003-01-06 13:26:24 +00:00
wiz a125d07668 Fix typos. Found by Adrian Mrva. 2002-10-29 16:12:25 +00:00
mycroft ab637af34b Minor cosmetica. 2002-09-20 19:23:58 +00:00