Commit Graph

284439 Commits

Author SHA1 Message Date
ryoon
7d49fb627c Fix a typo in debug message 2021-01-10 13:17:44 +00:00
rillig
c7eced1ab4 lint: explain missing error for _Bool constant expressions 2021-01-10 13:17:24 +00:00
rillig
a90a871c79 lint: fix conversion of non-constant scalar to _Bool 2021-01-10 12:46:38 +00:00
tkusumi
f8ac354381 fstyp: Sync HAMMER1/2 with DragonFly BSD
taken-from: DragonFly BSD
2021-01-10 12:38:40 +00:00
rillig
f8cc76a76d lint: fix conversion of constant expressions to _Bool 2021-01-10 12:34:56 +00:00
rillig
9d90fb23fe lint: add test for converting non-constant expressions to _Bool 2021-01-10 12:29:46 +00:00
rillig
a0c63d1765 lint: automate adding a test for lint1 2021-01-10 12:05:07 +00:00
rillig
e107438c00 lint: demonstrate wrong handling of conversion to _Bool 2021-01-10 11:24:42 +00:00
rillig
dadf0f419e lint: rename cvtcon to convert_constant
No functional change.
2021-01-10 11:17:53 +00:00
tsutsui
61cb7e57e0 Print rd(4) capacity and geometry info as sd(4) and wd(4) do.
Before:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 698 cylinders, 13 heads, 1116102 blocks, 512 bytes/block

After:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 544 MB, 698 cyl, 13 head, 123 sec, 512 bytes/block x 1116102 blocks
2021-01-10 00:58:56 +00:00
rillig
bfe7d5e162 lint: remove redundant braces in is_confusing_precedence
This nicely aligns the different branches, in which "l" and "r" are
swapped.

No functional change.
2021-01-10 00:12:50 +00:00
rillig
fe68124a52 lint: rename type classification macros
The previous names tspec_is_int and tspec_is_uint were confusing because
there are actually tspec_t constants called INT and UINT, these
classification macros return true for other integer types as well,
though.

While here, remove the prefix "tspec_" from these macros.  It wasn't as
helpful as intended, in many cases it was obviously redundant, when it
was called as tspec_is_integer(tn->tn_type->t_tspec).

No functional change.
2021-01-10 00:05:45 +00:00
wiz
93cc9aa740 Add magic incantation to configure an image for mount_udf(8). 2021-01-09 23:54:26 +00:00
rillig
13e81db968 lint: push down complexity from typeok to typeok_shr
Contrary to the comment in typeok, the types of the expressions before
promotions and conversions are not needed for SHL, SHLASS and SHRASS.
Move that code over to typeok_shr, the only place where it is actually
used.  This removes another 3 variables from typeok.
2021-01-09 23:18:19 +00:00
rillig
fe47a95707 lint: move pointer subtypes from typeok to the sub-functions
The code in typeok is already complicated enough.  Only few of the
checks actually examine the subtype of the pointer, the others don't
need to look at it.  Therefore don't initialize the variables lstp
(left-hand side subtype) and rstp unless they are actually needed.

This reduces the number of variables in typeok and the number of
parameters to the sub-functions.
2021-01-09 23:02:51 +00:00
rillig
6bb8504ff5 lint: add test for 116 "illegal pointer subtraction" 2021-01-09 22:55:36 +00:00
rillig
6c55876374 lint: make the table containing the operator properties more readable
The C preprocessor does not require its arguments to be expressions, an
empty string is valid as well.  This allows to replace the 0 in the
operator properties table with a space, making the 1 stick out.

Since the table is quite long, divide it into sections and add section
headers.

No change in the generated code.
2021-01-09 22:19:11 +00:00
rillig
8668691139 lint: rename ops.c to oper.c
The file ops.c had previously been autogenerated.  This meant that in a
NetBSD build, it was generated in OBJDIR, and a build that had just
updated src/usr.bin would fail.  For a build that last ran on
2020-12-01, and again today, it looks like this:

	#      link  lint1/lint1
	cc ... -o lint1 cgram.lo ... ops.lo ... tyname.lo
	/usr/bin/ld: ops.lo: in function `initmtab':
	ops.c:(.text+0x63): undefined reference to `STRUCT_ASSIGN'

This is caused by ops.c existing in OBJDIR, so the new version in
NETBSDSRCDIR is not looked at.  To prevent this, use oper.c instead as
the filename, which has not been used before.

https://mail-index.netbsd.org/source-changes-d/2021/01/09/msg013096.html
2021-01-09 21:37:44 +00:00
rillig
cc85ccc4e8 UPDATING: lint1/ops.c may require OBJDIR to be cleaned
https://mail-index.netbsd.org/source-changes-d/2021/01/09/msg013098.html
2021-01-09 20:51:08 +00:00
rillig
c52bdc3223 lint: change return type of typeok to bool
No functional change.
2021-01-09 19:13:17 +00:00
rillig
1d7ebe5271 lint: split typeok into several smaller functions
This reduces the number of local variables from 16 to around 5, in most
of the smaller functions.

No functional change.
2021-01-09 19:07:07 +00:00
christos
ca969aae02 preserve errno because we are doing system calls between error printing
and error setting.
2021-01-09 18:26:03 +00:00
christos
d71ebb0175 restore perror -> warn (reported by Havard Eidnes) 2021-01-09 18:22:42 +00:00
rillig
956d051a07 lint: extract typeok_amper from typeok
No functional change.
2021-01-09 18:21:08 +00:00
rillig
7f72829d0c lint: extract typeok_incdec from typeok
No functional change.
2021-01-09 18:15:14 +00:00
rillig
1d90d5eca8 lint: reorder table of operator properties
The 4 "requires" properties are now listed together, in descending
strictness.
2021-01-09 17:36:10 +00:00
rillig
1043e742ed lint: fix crash for error 108 (invalid type of unary operator) 2021-01-09 17:21:33 +00:00
rillig
fe02f4b2ac lint: add test for message 108, which currently crashes 2021-01-09 17:02:19 +00:00
christos
842f023a03 new pppd 2021-01-09 16:44:35 +00:00
christos
ff6bad0242 remove more 2021-01-09 16:41:09 +00:00
christos
56f8a139b1 remove useless files 2021-01-09 16:40:01 +00:00
christos
d6fdd0108f merge conflicts 2021-01-09 16:39:28 +00:00
christos
fa6d9a5307 What's new in ppp-2.4.9.
************************

* Support for new EAP (Extensible Authentication Protocol) methods:
  - Support for EAP-TLS, from Jan Just Keijser and others
  - Support for EAP-MSCHAPv2, from Eivind Næss, Thomas Omerzu, Tijs
    Van Buggenhout and others

* New pppd options:
  - chap-timeout
  - chapms-strip-domain
  - replacedefaultroute
  - noreplacedefaultroute
  - ipv6cp-accept-remote
  - lcp-echo-adaptive
  - ip-up-script
  - ip-down-script
  - ca
  - capath
  - cert
  - key
  - crl-dir
  - crl
  - max-tls-version
  - need-peer-eap

* Fixes for CVE-2020-8597 and CVE-2015-3310.

* libpcap is now required when compiling on Linux (previously, if
  libpcap was not present, pppd would be compiled without packet
  filtering support).

* The rp-pppoe plugin has been renamed to pppoe, to distinguish it
  from the upstream rp-pppoe code.  Its options have changed names,
  but the old names are kept as aliases.

* The configure script now supports cross-compilation.

* Many bug fixes and cleanups.


What was new in ppp-2.4.8.
**************************

* New pppd options have been added:
  - ifname, to set the name for the PPP interface device
  - defaultroute-metric, to set the metric for the default route
  - defaultroute6, to add an IPv6 default route (with nodefaultroute6
    to prevent adding an IPv6 default route)
  - up_sdnotify, to have pppd notify systemd when the link is up.

* The rp-pppoe plugin has new options:
  - host-uniq, to set the Host-Uniq value to send
  - pppoe-padi-timeout, to set the timeout for discovery packets
  - pppoe-padi-attempts, to set the number of discovery attempts.

* Added the CLASS attribute in radius packets.

* Sundry bug fixes.

* Fixed warnings and issues found by static analysis.

* Added Submitting-patches.md.


What was new in ppp-2.4.7.
**************************

* Fixed a potential security issue in parsing option files (CVE-2014-3158).

* There is a new "stop-bits" option, which takes an argument of 1 or 2,
  indicating the number of stop bits to use for async serial ports.

* Various bug fixes.


What was new in ppp-2.4.6.
**************************

* Man page updates.

* Several bug fixes.

* Options files can now set and unset environment variables for
  scripts.

* The timeout for chat scripts can now be taken from an environment
  variable.

* There is a new option, master_detach, which allows pppd to detach
  from the controlling terminal when it is the multilink bundle master
  but its own link has terminated, even if the nodetach option has
  been given.
2021-01-09 16:37:35 +00:00
mlelstv
3b6e7d0308 Also replace calls to dirname. 2021-01-09 16:25:19 +00:00
rillig
462cbdfa37 make(1): fix lint warnings 2021-01-09 16:06:09 +00:00
rillig
232122fb53 lint: add test for message 160 2021-01-09 15:32:06 +00:00
christos
63840c068e PR/55916: William Ahern: cmp -s + regular files + skipping is broken
Move test after length is adjusted
2021-01-09 15:16:28 +00:00
jmcneill
9c47495753 Avoid mismatched memory attributes for kernel and page table memory.
The initial page table code enters mappings first through an identity
mapped normal-NC mapping. Then later on, additional mappings are added
through a KVA-mapped normal-WB mapping. There is a warning about this
in the Armv8 ARM:

  Bytes written without the Write-Back cacheable attribute within the
  same Write-Back granule as bytes written with the Write-Back cacheable
  attribute might have their values reverted to the old values as a result
  of cache Write-Back.

Change the identity mapping attributes to match the KVA-mapping. This
fixes an issue where the kernel often doesn't start under ESXi-Arm Fling.
2021-01-09 15:07:42 +00:00
rillig
e3ae774eba lint: add tests for messages 117, 120, 125, 127 2021-01-09 14:37:16 +00:00
rillig
6b6b847fc8 lint: allow tests to specify additional flags
Several of the tests only need to add the -p flag.  Mentioning the
(current) default flags in each of these tests is redundant.  Therefore,
allow them to specify "lint1-extra-flags: -p" instead of the current
"lint1-flags: -g -S -w -p".
2021-01-09 14:33:53 +00:00
rillig
63bde02018 lint: make target platform independent of host platform
If lint is run on a platform that has CHAR_BIT == 10, this doesn't
magically make an ILP32 platform have 40 bits per uint32_t.

At the moment, all of the supported platforms are either ILP32 or
I32LP64 anyway, and all of them have CHAR_BIT == 8 == CHAR_SIZE,
so nothing changes practically.
2021-01-09 14:10:12 +00:00
mlelstv
1f9fa21d0b Remove need for awk/sed/readlink tools. 2021-01-09 14:00:05 +00:00
rillig
6e4238f485 lint: remove trailing whitespace 2021-01-09 13:58:43 +00:00
jmcneill
edb0e4b731 Fix a potential issue in pmapboot_enter_range and pmapboot_enter where
if the va and size are not page aligned, there is a possibility of the
last page not being taken into consideration.
2021-01-09 13:42:25 +00:00
jmcneill
5e7fb2bb1e Flush from kernel start, not the entry point. 2021-01-09 13:19:27 +00:00
jmcneill
4720bc30f5 Style fixes, NFCI. 2021-01-09 13:15:15 +00:00
rillig
4ba4b93100 lint: rename ename to enumeration_constant 2021-01-09 13:12:13 +00:00
rillig
16d75acecd lint: align grammar rules with C99 2021-01-09 03:28:47 +00:00
rillig
1119ffe1ba lint: expand abbreviations in grammar rules
stmnt -> statement
comp -> compound

The abbreviation "stmnt" was non-standard, and "comp" was ambiguous
since it is used for "comparison" as well.
2021-01-09 03:08:54 +00:00
uki
1c2777d6b9 Fix "build.sh syspkgs" build error 2021-01-09 02:40:44 +00:00