Dimitry Andric
cb3b0d8fb9
Unfortunately, clang gives warnings about sendmail code that cannot be
...
turned off yet. Since this is contrib code, and we don't really care
about the warnings, just turn make them non-fatal for now.
MFC after: 1 week
2011-12-17 18:39:04 +00:00
Dimitry Andric
e9db6b2474
In contrib/telnet/telnet/utilities.c, fix a few warnings about format
...
strings not being literals.
MFC after: 1 week
2011-12-17 18:18:36 +00:00
Dimitry Andric
288fcda320
In usr.bin/netstat/atalk.c, work around a clang false positive with
...
printf format warnings and conditional operators.
MFC after: 1 week
2011-12-17 17:21:47 +00:00
Dimitry Andric
d411ccb3b2
Use NO_WCAST_ALIGN for usr.bin/ncplist, as there are many potential
...
alignment issues in it. (Though I doubt anyone still cares about
NetWare support...)
MFC after: 1 week
2011-12-17 17:04:30 +00:00
Mikolaj Golub
fa3935bcea
On start most of sysctl_kern_proc functions use the same pattern:
...
locate a process calling pfind() and do some additional checks like
p_candebug(). To reduce this code duplication a new function pget() is
introduced and used.
As the function may be useful not only in kern_proc.c it is in the
kernel name space.
Suggested by: kib
Reviewed by: kib
MFC after: 2 weeks
2011-12-17 16:59:22 +00:00
Dimitry Andric
081aa5169d
In usr.bin/mail/cmd1.c, use the correct printf length modifier for a
...
ptrdiff_t. In usr.bin/mail/main.c, cast a field width to int.
MFC after: 1 week
2011-12-17 16:30:42 +00:00
Nathan Whitehorn
4b51c69976
Additional icache paranoia: non-PLT relocations can modify the text segment.
...
It is then important to make sure the icache is synchronized again to
prevent (rare) random seg faults and illegal instructions.
MFC after: 3 days
2011-12-17 16:20:27 +00:00
Dimitry Andric
8ee4178c4c
In contrib/less, cast away const a bunch of times, to make it build
...
without conversion warnings. This code desparately needs a good dose of
const poison, but fixing all the issues would be rather disruptive.
MFC after: 1 week
2011-12-17 16:10:14 +00:00
Andriy Gapon
8f3ae92165
syscons: provide a first iteration of cngrab/cnungrab implementation
...
- put underlying keyboard(s) into the polling mode for the whole
duration of the grab, instead of the previous behavior of going into
and out of the polling mode around each polling attempt
- ditto for setting K_XLATE mode and enabling a disabled keyboard
Inspired by: bde
MFC after: 2 months
2011-12-17 15:57:39 +00:00
Andriy Gapon
f389bc9585
belatedly transfer copyrights from libkern/gets.c to kern_cons.c
...
MFC after: 2 months
MFC with: r228642
2011-12-17 15:50:45 +00:00
Andriy Gapon
6aa40c0146
retire libkern gets
...
Inspired by: bde
MFC after: 2 months
X-MFC-Note: if deemed a part of KPI, just call cngets internally
2011-12-17 15:48:55 +00:00
Bjoern A. Zeeb
9b776960c3
Allow toggling of IFCAP_VLAN_HWCSUM for hardware that supports checksum
...
offloading on vlans and document the new option.
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
2011-12-17 15:44:34 +00:00
Bjoern A. Zeeb
3b29d0033d
Unbreak the OCTEON1 kernel build after r228483 removing the left over
...
declaration.
MFC after: 11 days
2011-12-17 15:42:37 +00:00
Dimitry Andric
f7c0d4c7ea
In usr.bin/indent/io.c, fix a few warnings about format strings not being literals.
...
MFC after: 1 week
2011-12-17 15:41:58 +00:00
Andriy Gapon
ac8dee6952
move GETS_*ECHO* defintions from libkern.h to cons.h
...
MFC after: 2 months
2011-12-17 15:39:14 +00:00
Kevin Lo
0022629fe0
Another axe(4), found in ASUS zenbook.
2011-12-17 15:38:16 +00:00
Dimitry Andric
7818f8df2e
Correct a logic error in usr.bin/hexdump/conv.c, found by clang.
...
Whenever the conv_c() function encounters an incomplete multibyte char,
it peeks ahead. It also sets p to peekbuf, to indicate it is still
processing the incomplete character.
However, on the next retry, it compares buf against peekbuf, which
always returns false, since both buf and peekbuf are local char arrays,
whose addresses are never the same.
Fix this by comparing against p instead, which was the intention. Also
turn peekbuf into an array of u_char, to prevent conversion warnings.
MFC after: 1 week
2011-12-17 15:33:26 +00:00
Nathan Whitehorn
17bbcc52d1
Fix RTLD on PowerPC after r228435. Changing the order of init_pltgot()
...
caused the icache to be invalidated at the wrong time, resulting in
an icache full of nonsense in the PLT section.
2011-12-17 15:31:00 +00:00
Andriy Gapon
f6ce353e58
replace uses of libkern gets with cngets
...
MFC after: 2 months
2011-12-17 15:26:34 +00:00
Andriy Gapon
8e62854265
introduce cngets, a method for kernel to read a string from console
...
This is intended as a replacement for libkern's gets and mostly borrows
its implementation. It uses cngrab/cnungrab to delimit kernel's access
to console input.
Note: libkern's gets obviously doesn't share any bits of implementation
iwth libc's gets. They also have different APIs and the former doesn't
have the overflow problems of the latter.
Inspired by: bde
MFC after: 2 months
2011-12-17 15:16:54 +00:00
Andriy Gapon
bf8696b408
introduce cngrab/cnungrab stub calls in some places where they make sense
...
MFC after: 2 months
2011-12-17 15:11:22 +00:00
Andriy Gapon
9976156f12
kern cons: introduce infrastructure for console grabbing by kernel
...
At the moment grab and ungrab methods of all console drivers are no-ops.
Current intended meaning of the calls is that the kernel takes control of
console input. In the future the semantics may be extended to mean that
the calling thread takes full ownership of the console (e.g. console
output from other threads could be suspended).
Inspired by: bde
MFC after: 2 months
2011-12-17 15:08:43 +00:00
Michael Tuexen
5dc6a81580
Address warnings found by clang.
...
MFC after: 3 months.
2011-12-17 14:55:19 +00:00
Dimitry Andric
7853817de3
More fixes for correct printf length modifiers usr.bin/gprof.
...
MFC after: 1 week
2011-12-17 14:51:24 +00:00
Dimitry Andric
d16752d1ae
In usr.bin/gprof/aout.c, use the correct printf length modifier for a
...
uint32_t.
MFC after: 1 week
2011-12-17 14:37:41 +00:00
Dimitry Andric
8f04da68ad
In contrib/ee/ee.c, fix a few warnings about format strings not being
...
literals. Also, change the direction argument to move_rel() from char
to int; K&R function definions cause it to be promoted to an int anyway,
and this way we avoid clang warning about it.
MFC after: 1 week
2011-12-17 14:26:16 +00:00
Dimitry Andric
f666b9058d
In usr.bin/csup/proto.c, use the correct printf length modifier to print
...
an off_t.
MFC after: 1 week
2011-12-17 13:52:53 +00:00
Dimitry Andric
582ad8aebf
In usr.bin/csup/auth.c, use the correct number of bytes for zeroing the
...
shared secret, and use long long format to snprintf a time_t.
MFC after: 1 week
2011-12-17 13:14:44 +00:00
Dimitry Andric
586f63035f
In contrib/bzip2/bzip2recover.c, use the correct printf length modifier
...
for unsigned long long.
MFC after: 1 week
2011-12-17 12:52:58 +00:00
Bjoern A. Zeeb
1e629ba90f
Adter r228571 unbreak architectures with strict alignment rules
...
by copying rather than casting.
2011-12-17 11:06:22 +00:00
Bernhard Schmidt
5a8801b0ea
Remove now redundant mac argument.
...
Discussed with: adrian@
2011-12-17 10:32:31 +00:00
Bernhard Schmidt
fcd9500f91
Fix some net80211 enum nits:
...
- ic_vap_create() uses an ieee80211_opmode argument
- ieee80211_rate2media() takes an ieee80211_phymode argument
- ieee80211_plcp2rate() takes an ieee80211_phytype argument
- cast to enum ieee80211_protmode and ieee80211_roamingmode to silence
compiler warnings
Submitted by: arundel@
2011-12-17 10:23:17 +00:00
Ruslan Ermilov
e9a2004460
Fixed some of markup.
...
Reviewed by: jhb
2011-12-17 06:57:35 +00:00
Dimitry Andric
f3fbaba136
In usr.bin/mt/mt.c, the c_code member of struct commands should really
...
be an unsigned long, since it will contain values of ioctl request
codes. On 64-bit arches, these will not fit into an int.
MFC after: 1 week
2011-12-17 02:23:30 +00:00
Dimitry Andric
b884d5e84a
In sbin/devd/devd.h, 'event_proc' and 'eps' are declared as structs. In
...
devd.hh, there are redeclared as classes. Fix the inconsistency.
MFC after: 1 week
2011-12-17 01:54:51 +00:00
Dimitry Andric
9b9c36a3b5
Disable yet another clang warning when WARNS <= 3.
...
MFC after: 1 week
2011-12-17 01:51:12 +00:00
Dimitry Andric
940695fffb
In usr.bin/tar/tree.c, if you really want to poke to NULL, you must use
...
volatile, otherwise the indirection will not be emitted.
MFC after: 1 week
2011-12-17 01:36:50 +00:00
Dimitry Andric
7824741286
In sbin/dhclient, since we know the size of the source strings anyway,
...
we might as well use memcpy; strlcpy is really unnecessary here.
MFC after: 1 week
2011-12-17 01:29:46 +00:00
Dimitry Andric
e2f95dd941
In sbin/dhclient, work around warnings about the size argument to
...
strlcpy appearing to be the size of the source buffer, instead of the
destination.
MFC after: 1 week
2011-12-17 01:19:07 +00:00
Dimitry Andric
650fd1e4e4
Use both NO_WFORMAT and NO_WARRAY_BOUNDS for sbin/ipf, it would be too
...
disruptive to actually fix all the warnings, and the code hasn't been
maintained for several years.
MFC after: 1 week
2011-12-17 00:54:09 +00:00
Dimitry Andric
5323d72245
In sbin/atm/atmconfig/diag.c, fix a few warnings about format strings
...
not being literals.
MFC after: 1 week
2011-12-17 00:26:45 +00:00
Dimitry Andric
c0a8e7ad42
Use NO_WCAST_ALIGN for sbin/gbde, this is more appropriate to fix the
...
alignment warnings than using WARNS=3, and it also works for clang.
MFC after: 1 week
2011-12-17 00:14:40 +00:00
Nathan Whitehorn
e347e23bfe
Allow this to work on embedded systems without Open Firmware by making
...
lack of a /chosen non-fatal, and manually removing memory in use by the
kernel from the physical memory map.
Submitted by: rpaulo
2011-12-16 23:46:05 +00:00
Dimitry Andric
1ff68ea3a0
Use NO_WARRAY_BOUNDS for sbin/routed/rtquery.
...
MFC after: 1 week
2011-12-16 23:43:58 +00:00
Dimitry Andric
c9009f9f3d
Add a NO_WARRAY_BOUNDS setting to bsd.sys.mk, only applicable to clang,
...
to selectively work around warnings in programs that don't use flexible
array members, but instead define arrays of length 1 at the end of the
struct, and then access those beyond their declared bounds.
MFC after: 1 week
2011-12-16 23:42:25 +00:00
Nathan Whitehorn
b059c637fb
Zero BSS on start, in case the ELF loader that started the kernel did not
...
do this for us. This can happen on some embedded systems.
Submitted by: rpaulo
2011-12-16 23:40:56 +00:00
Dimitry Andric
cf87966cfd
In contrib/gperf/src/output.cc, use the correct printf length modifier
...
for a ptrdiff_t.
MFC after: 1 week
2011-12-16 23:15:11 +00:00
Dimitry Andric
9733a9e463
In sbin/fsdb/fsdbutil.c, work around a clang false positive with printf
...
format warnings and conditional operators. (See LLVM PR 11313 for more
information.)
MFC after: 1 week
2011-12-16 23:09:31 +00:00
Dimitry Andric
8fec2463ca
In sbin/camcontrol/camcontrol.c, fix a few warnings about format strings
...
not being literals.
MFC after: 1 week
2011-12-16 22:35:19 +00:00
Dimitry Andric
6aff93296d
Define YY_NO_INPUT when building libbinutils, to prevent warnings about
...
unused input() functions emitted by lex.
MFC after: 1 week
2011-12-16 22:19:13 +00:00