CVS commit: src/usr.sbin/tprof/arch
Module Name:src Committed By: msaitoh Date: Fri Jul 7 04:43:15 UTC 2023 Modified Files: src/usr.sbin/tprof/arch: tprof_x86.c Log Message: tprof(8): Add support for Skylake-X and Cascade Lake. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/tprof/arch/tprof_x86.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/tprof/arch/tprof_x86.c diff -u src/usr.sbin/tprof/arch/tprof_x86.c:1.18 src/usr.sbin/tprof/arch/tprof_x86.c:1.19 --- src/usr.sbin/tprof/arch/tprof_x86.c:1.18 Fri Jul 7 04:37:03 2023 +++ src/usr.sbin/tprof/arch/tprof_x86.c Fri Jul 7 04:43:15 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: tprof_x86.c,v 1.18 2023/07/07 04:37:03 msaitoh Exp $ */ +/* $NetBSD: tprof_x86.c,v 1.19 2023/07/07 04:43:15 msaitoh Exp $ */ /* * Copyright (c) 2018-2019 The NetBSD Foundation, Inc. @@ -529,11 +529,276 @@ init_intel_skylake_kabylake(void) return _skylake_kabylake; } +/* + * Intel Skylake-X (and Cascade Lake). + */ +static struct name_to_event intel_skylake_x_names[] = { + { "INST_RETIRED.ANY",0x00, 0x01, true }, + { "CPU_CLK_UNHALTED.THREAD", 0x00, 0x02, true }, + { "CPU_CLK_UNHALTED.REF_TSC", 0x00, 0x03, true }, + { "LD_BLOCKS.STORE_FORWARD", 0x03, 0x02, true }, + { "LD_BLOCKS.NO_SR",0x03, 0x08, true }, + { "LD_BLOCKS_PARTIAL.ADDRESS_ALIAS", 0x07, 0x01, true }, + { "DTLB_LOAD_MISSES.MISS_CAUSES_A_WALK", 0x08, 0x01, true }, + { "DTLB_LOAD_MISSES.WALK_COMPLETED_4K", 0x08, 0x02, true }, + { "DTLB_LOAD_MISSES.WALK_COMPLETED_2M_4M", 0x08, 0x04, true }, + { "DTLB_LOAD_MISSES.WALK_COMPLETED_1G", 0x08, 0x08, true }, + { "DTLB_LOAD_MISSES.WALK_COMPLETED", 0x08, 0x0E, true }, + { "DTLB_LOAD_MISSES.WALK_PENDING", 0x08, 0x10, true }, + { "DTLB_LOAD_MISSES.STLB_HIT", 0x08, 0x20, true }, + { "INT_MISC.RECOVERY_CYCLES", 0x0D, 0x01, true }, + { "INT_MISC.CLEAR_RESTEER_CYCLES", 0x0D, 0x80, true }, + { "UOPS_ISSUED.ANY",0x0E, 0x01, true }, + { "UOPS_ISSUED.VECTOR_WIDTH_MISMATCH", 0x0E, 0x02, true }, + { "UOPS_ISSUED.SLOW_LEA", 0x0E, 0x20, true }, + { "ARITH.DIVIDER_ACTIVE", 0x14, 0x01, true }, + { "L2_RQSTS.DEMAND_DATA_RD_MISS", 0x24, 0x21, true }, + { "L2_RQSTS.RFO_MISS",0x24, 0x22, true }, + { "L2_RQSTS.CODE_RD_MISS", 0x24, 0x24, true }, + { "L2_RQSTS.ALL_DEMAND_MISS", 0x24, 0x27, true }, + { "L2_RQSTS.PF_MISS",0x24, 0x38, true }, + { "L2_RQSTS.MISS",0x24, 0x3F, true }, + { "L2_RQSTS.DEMAND_DATA_RD_HIT", 0x24, 0x41, true }, + { "L2_RQSTS.RFO_HIT",0x24, 0x42, true }, + { "L2_RQSTS.CODE_RD_HIT", 0x24, 0x44, true }, + { "L2_RQSTS.PF_HIT",0x24, 0xD8, true }, + { "L2_RQSTS.ALL_DEMAND_DATA_RD", 0x24, 0xE1, true }, + { "L2_RQSTS.ALL_RFO",0x24, 0xE2, true }, + { "L2_RQSTS.ALL_CODE_RD", 0x24, 0xE4, true }, + { "L2_RQSTS.ALL_DEMAND_REFERENCES", 0x24, 0xE7, true }, + { "L2_RQSTS.ALL_PF",0x24, 0xF8, true }, + { "L2_RQSTS.REFERENCES All L2", 0x24, 0xFF, true }, + { "CORE_POWER.LVL0_TURBO_LICENSE", 0x28, 0x07, true }, + { "CORE_POWER.LVL1_TURBO_LICENSE", 0x28, 0x18, true }, + { "CORE_POWER.LVL2_TURBO_LICENSE", 0x28, 0x20, true }, + { "CORE_POWER.THROTTLE", 0x28, 0x40, true }, + { "LONGEST_LAT_CACHE.MISS", 0x2E, 0x41, true }, + { "LONGEST_LAT_CACHE.REFERENCE", 0x2E, 0x4F, true }, + { "CPU_CLK_UNHALTED.THREAD_P", 0x3C, 0x00, true }, + { "CPU_CLK_THREAD_UNHALTED.REF_XCLK", 0x3C, 0x01, true }, + { "CPU_CLK_THREAD_UNHALTED.ONE_THREAD_ACTIVE", 0x3C, 0x02, true }, + { "L1D_PEND_MISS.PENDING", 0x48, 0x01, true }, + { "L1D_PEND_MISS.FB_FULL", 0x48, 0x02, true }, + { "DTLB_STORE_MISSES.MISS_CAUSES_A_WALK", 0x49, 0x01, true }, + { "DTLB_STORE_MISSES.WALK_COMPLETED_4K", 0x49, 0x02, true }, + { "DTLB_STORE_MISSES.WALK_COMPLETED_2M_4M", 0x49, 0x04, true }, + { "DTLB_STORE_MISSES.WALK_COMPLETED_1G", 0x49, 0x08, true }, + { "DTLB_STORE_MISSES.WALK_COMPLETED", 0x49, 0x0E, true }, + { "DTLB_STORE_MISSES.WALK_PENDING", 0x49, 0x10, true }, + { "DTLB_STORE_MISSES.STLB_HIT", 0x49, 0x20, true }, + { "LOAD_HIT_PRE.SW_PF",0x4C, 0x01, true }, + { "EPT.WALK_PENDING",0x4F, 0x10, true }, + { "L1D.REPLACEMENT",0x51, 0x01, true }, + { "TX_MEM.ABORT_CONFLICT", 0x54, 0x01, true }, + { "TX_MEM.ABORT_CAPACITY", 0x54, 0x02, true }, + { "TX_MEM.ABORT_HLE_STORE_TO_ELIDED_LOCK", 0x54, 0x04, true }, + { "TX_MEM.ABORT_HLE_ELISION_BUFFER_NOT_EMPTY", 0x54, 0x08, true }, + { "TX_MEM.ABORT_HLE_ELISION_BUFFER_MISMATCH", 0x54, 0x10, true }, + { "TX_MEM.ABORT_HLE_ELISION_BUFFER_UNSUPPORTED_ALIGNMENT", + 0x54, 0x20, true }, + { "TX_MEM.HLE_ELISION_BUFFER_FULL", 0x54, 0x40, true }, + { "TX_EXEC.MISC1",0x5D, 0x01, true }, + { "TX_EXEC.MISC2",0x5D, 0x02, true }, + { "TX_EXEC.MISC3",0x5D, 0x04, true }, + { "TX_EXEC.MISC4",0x5D, 0x08, true }, + { "TX_EXEC.MISC5",0x5D, 0x10, true }, + { "RS_EVENTS.EMPTY_CYCLES", 0x5E, 0x01, true }, + { "OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD", + 0x60, 0x01, true },
CVS commit: src/usr.sbin/tprof/arch
Module Name:src Committed By: msaitoh Date: Fri Jul 7 04:43:15 UTC 2023 Modified Files: src/usr.sbin/tprof/arch: tprof_x86.c Log Message: tprof(8): Add support for Skylake-X and Cascade Lake. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/tprof/arch/tprof_x86.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin/tprof/arch
Module Name:src Committed By: msaitoh Date: Fri Jul 7 04:37:03 UTC 2023 Modified Files: src/usr.sbin/tprof/arch: tprof_x86.c Log Message: Modify comment. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/tprof/arch/tprof_x86.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/tprof/arch/tprof_x86.c diff -u src/usr.sbin/tprof/arch/tprof_x86.c:1.17 src/usr.sbin/tprof/arch/tprof_x86.c:1.18 --- src/usr.sbin/tprof/arch/tprof_x86.c:1.17 Wed Apr 12 02:15:51 2023 +++ src/usr.sbin/tprof/arch/tprof_x86.c Fri Jul 7 04:37:03 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: tprof_x86.c,v 1.17 2023/04/12 02:15:51 msaitoh Exp $ */ +/* $NetBSD: tprof_x86.c,v 1.18 2023/07/07 04:37:03 msaitoh Exp $ */ /* * Copyright (c) 2018-2019 The NetBSD Foundation, Inc. @@ -570,10 +570,10 @@ init_intel_generic(void) break; case 0x4e: /* Skylake */ case 0x5e: /* Skylake */ - case 0x8e: /* Kabylake */ - case 0x9e: /* Kabylake */ - case 0xa5: /* Cometlake */ - case 0xa6: /* Cometlake */ + case 0x8e: /* Kaby Lake */ + case 0x9e: /* Kaby Lake */ + case 0xa5: /* Comet Lake */ + case 0xa6: /* Comet Lake */ table->next = init_intel_skylake_kabylake(); break; }
CVS commit: src/usr.sbin/tprof/arch
Module Name:src Committed By: msaitoh Date: Fri Jul 7 04:37:03 UTC 2023 Modified Files: src/usr.sbin/tprof/arch: tprof_x86.c Log Message: Modify comment. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/tprof/arch/tprof_x86.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/sys
Module Name:src Committed By: riastradh Date: Fri Jul 7 01:31:25 UTC 2023 Modified Files: src/lib/libc/sys: poll.2 select.2 Log Message: select(2), poll(2): Clarify return values. To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/lib/libc/sys/poll.2 cvs rdiff -u -r1.43 -r1.44 src/lib/libc/sys/select.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/sys/poll.2 diff -u src/lib/libc/sys/poll.2:1.37 src/lib/libc/sys/poll.2:1.38 --- src/lib/libc/sys/poll.2:1.37 Tue Feb 9 09:01:29 2021 +++ src/lib/libc/sys/poll.2 Fri Jul 7 01:31:25 2023 @@ -1,4 +1,4 @@ -.\" $NetBSD: poll.2,v 1.37 2021/02/09 09:01:29 wiz Exp $ +.\" $NetBSD: poll.2,v 1.38 2023/07/07 01:31:25 riastradh Exp $ .\" .\" Copyright (c) 1998, 2005, 2020 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -210,8 +210,10 @@ Sockets produce POLLIN rather than POLLH end is closed. .Sh RETURN VALUES .Fn poll -returns the number of descriptors that are ready for I/O, or \-1 if an -error occurred. +returns the number of descriptors that are ready for I/O, or returns +\-1 and sets +.Dv errno +if an error occurred. If the time limit expires, .Fn poll returns 0. Index: src/lib/libc/sys/select.2 diff -u src/lib/libc/sys/select.2:1.43 src/lib/libc/sys/select.2:1.44 --- src/lib/libc/sys/select.2:1.43 Wed Oct 25 17:39:47 2017 +++ src/lib/libc/sys/select.2 Fri Jul 7 01:31:25 2023 @@ -1,4 +1,4 @@ -.\" $NetBSD: select.2,v 1.43 2017/10/25 17:39:47 abhinav Exp $ +.\" $NetBSD: select.2,v 1.44 2023/07/07 01:31:25 riastradh Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -155,7 +155,9 @@ interface instead, which tends to be mor .Fn select returns the number of ready descriptors that are contained in the descriptor sets, -or \-1 if an error occurred. +or returns \-1 and sets +.Dv errno +if an error occurred. If the time limit expires, .Fn select returns 0.
CVS commit: src/lib/libc/sys
Module Name:src Committed By: riastradh Date: Fri Jul 7 01:31:25 UTC 2023 Modified Files: src/lib/libc/sys: poll.2 select.2 Log Message: select(2), poll(2): Clarify return values. To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/lib/libc/sys/poll.2 cvs rdiff -u -r1.43 -r1.44 src/lib/libc/sys/select.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Fri Jul 7 00:25:23 UTC 2023 Modified Files: src/tests/usr.bin/xlint/lint1: msg_351.c Log Message: tests/lint: test all combinations of {func,obj}_{decl,def} For a non-static function definition that is not declared in a header, lint doesn't currently warn. The previous test didn't notice this. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_351.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/lint1/msg_351.c diff -u src/tests/usr.bin/xlint/lint1/msg_351.c:1.5 src/tests/usr.bin/xlint/lint1/msg_351.c:1.6 --- src/tests/usr.bin/xlint/lint1/msg_351.c:1.5 Wed Jun 28 17:53:21 2023 +++ src/tests/usr.bin/xlint/lint1/msg_351.c Fri Jul 7 00:25:23 2023 @@ -1,54 +1,103 @@ -/* $NetBSD: msg_351.c,v 1.5 2023/06/28 17:53:21 rillig Exp $ */ +/* $NetBSD: msg_351.c,v 1.6 2023/07/07 00:25:23 rillig Exp $ */ # 3 "msg_351.c" // Test for message 351: missing%s header declaration for '%s' [351] /* - * Warn about variable definitions or function definitions that are visible - * outside the current translation unit but do not have a previous + * Warn about declarations or definitions for functions or objects that are + * visible outside the current translation unit but do not have a previous * declaration in a header file. * * All symbols that are used across translation units should be declared in a * header file, to ensure consistent types. * * Since the storage class 'extern' is redundant for functions but not for - * objects, omit it for functions. + * objects, the diagnostic omits it for functions. * * https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wmissing-declarations */ -/* expect+1: warning: missing header declaration for 'implicitly_extern_function' [351] */ -void implicitly_extern_function(void); -/* expect+1: warning: missing header declaration for 'explicitly_extern_function' [351] */ -extern void explicitly_extern_function(void); - -/* expect+1: warning: missing 'extern' header declaration for 'definition' [351] */ -int definition; -/* expect+1: warning: missing 'extern' header declaration for 'reference' [351] */ -extern int reference; -/* expect+1: warning: static variable 'file_scoped_definition' unused [226] */ -static int file_scoped_definition; +/* expect+1: warning: missing header declaration for 'func_decl' [351] */ +void func_decl(void); +/* expect+1: warning: missing header declaration for 'extern_func_decl' [351] */ +extern void extern_func_decl(void); +static int static_func_decl(void); + +// TODO: missing header declaration +void +func_def(void) +{ +} + +// TODO: missing header declaration +extern void +extern_func_def(void) +{ +} + +/* expect+2: warning: static function 'static_func_def' unused [236] */ +static void +static_func_def(void) +{ +} + +/* expect+1: warning: missing 'extern' header declaration for 'obj_decl' [351] */ +extern int obj_decl; +/* expect+1: warning: missing 'extern' header declaration for 'obj_def' [351] */ +int obj_def; +static int static_obj_def; # 18 "header.h" 1 3 4 -static int static_def; -int external_def; -extern int external_ref; - -static int static_func_def(void); -int extern_func_decl(void); -extern int extern_func_decl_verbose(void); - -# 43 "msg_351.c" 2 -/* expect+1: warning: static variable 'static_def' unused [226] */ -static int static_def; -int external_def; -extern int external_ref; - -/* expect+1: warning: static function 'static_func_def' declared but not defined [290] */ -static int static_func_def(void); -int extern_func_decl(void); -extern int extern_func_decl_verbose(void); +void func_decl(void); +extern void extern_func_decl(void); +static int static_func_decl(void); + +void func_def(void); +extern void extern_func_def(void); +static void static_func_def(void); + +void func_def_ok(void); +extern void extern_func_def_ok(void); +static void static_func_def_ok(void); + +extern int obj_decl; +int obj_def; +static int static_obj_def; + +# 70 "msg_351.c" 2 + +void func_decl(void); +extern void extern_func_decl(void); +/* expect+1: warning: static function 'static_func_decl' declared but not defined [290] */ +static int static_func_decl(void); + +void +func_def_ok(void) +{ +} + +extern void +extern_func_def_ok(void) +{ +} + +/* expect+2: warning: static function 'static_func_def_ok' unused [236] */ +static void +static_func_def_ok(void) +{ +} + +extern int obj_decl; +int obj_def; +/* expect+1: warning: static variable 'static_obj_def' unused [226] */ +static int static_obj_def; + + +/* + * Do not warn about the temporary identifier generated for the object from the + * compound literal. + */ /* expect+1: warning: missing 'extern' header declaration for 'dbl_ptr' [351] */ double *dbl_ptr = &(double) { 0.0 };
CVS commit: src/tests/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Fri Jul 7 00:25:23 UTC 2023 Modified Files: src/tests/usr.bin/xlint/lint1: msg_351.c Log Message: tests/lint: test all combinations of {func,obj}_{decl,def} For a non-static function definition that is not declared in a header, lint doesn't currently warn. The previous test didn't notice this. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_351.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src
Module Name:src Committed By: rillig Date: Fri Jul 7 00:20:39 UTC 2023 Modified Files: src/distrib/sets/lists/tests: mi src/tests/usr.bin/xlint/lint1: c11_atomic.c c11_generic_expression.c msg_350.c Removed Files: src/tests/usr.bin/xlint/lint1: c99_atomic.c Log Message: tests/lint: merge duplicate tests for C11 _Atomic To generate a diff of this commit: cvs rdiff -u -r1.1274 -r1.1275 src/distrib/sets/lists/tests/mi cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/c11_atomic.c cvs rdiff -u -r1.15 -r1.16 \ src/tests/usr.bin/xlint/lint1/c11_generic_expression.c cvs rdiff -u -r1.3 -r0 src/tests/usr.bin/xlint/lint1/c99_atomic.c cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_350.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src
Module Name:src Committed By: rillig Date: Fri Jul 7 00:20:39 UTC 2023 Modified Files: src/distrib/sets/lists/tests: mi src/tests/usr.bin/xlint/lint1: c11_atomic.c c11_generic_expression.c msg_350.c Removed Files: src/tests/usr.bin/xlint/lint1: c99_atomic.c Log Message: tests/lint: merge duplicate tests for C11 _Atomic To generate a diff of this commit: cvs rdiff -u -r1.1274 -r1.1275 src/distrib/sets/lists/tests/mi cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/c11_atomic.c cvs rdiff -u -r1.15 -r1.16 \ src/tests/usr.bin/xlint/lint1/c11_generic_expression.c cvs rdiff -u -r1.3 -r0 src/tests/usr.bin/xlint/lint1/c99_atomic.c cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_350.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/tests/mi diff -u src/distrib/sets/lists/tests/mi:1.1274 src/distrib/sets/lists/tests/mi:1.1275 --- src/distrib/sets/lists/tests/mi:1.1274 Wed Jul 5 11:36:56 2023 +++ src/distrib/sets/lists/tests/mi Fri Jul 7 00:20:39 2023 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1274 2023/07/05 11:36:56 rillig Exp $ +# $NetBSD: mi,v 1.1275 2023/07/07 00:20:39 rillig Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -6512,7 +6512,7 @@ ./usr/tests/usr.bin/xlint/lint1/c23.ctests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/xlint/lint1/c90.ctests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/xlint/lint1/c90.exptests-obsolete obsolete,atf -./usr/tests/usr.bin/xlint/lint1/c99_atomic.c tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/xlint/lint1/c99_atomic.c tests-obsolete obsolete,atf ./usr/tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.c tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.exp tests-obsolete obsolete ./usr/tests/usr.bin/xlint/lint1/c99_init_array.c tests-obsolete obsolete,atf Index: src/tests/usr.bin/xlint/lint1/c11_atomic.c diff -u src/tests/usr.bin/xlint/lint1/c11_atomic.c:1.3 src/tests/usr.bin/xlint/lint1/c11_atomic.c:1.4 --- src/tests/usr.bin/xlint/lint1/c11_atomic.c:1.3 Sat Jan 21 13:48:40 2023 +++ src/tests/usr.bin/xlint/lint1/c11_atomic.c Fri Jul 7 00:20:39 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: c11_atomic.c,v 1.3 2023/01/21 13:48:40 rillig Exp $ */ +/* $NetBSD: c11_atomic.c,v 1.4 2023/07/07 00:20:39 rillig Exp $ */ # 3 "c11_atomic.c" /* @@ -8,6 +8,7 @@ * See also: * C11 6.7.3 Type qualifiers * C11 6.7.2.4 Atomic type specifiers + * msg_350.c */ /* lint1-extra-flags: -Ac11 */ Index: src/tests/usr.bin/xlint/lint1/c11_generic_expression.c diff -u src/tests/usr.bin/xlint/lint1/c11_generic_expression.c:1.15 src/tests/usr.bin/xlint/lint1/c11_generic_expression.c:1.16 --- src/tests/usr.bin/xlint/lint1/c11_generic_expression.c:1.15 Tue Mar 28 14:44:34 2023 +++ src/tests/usr.bin/xlint/lint1/c11_generic_expression.c Fri Jul 7 00:20:39 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: c11_generic_expression.c,v 1.15 2023/03/28 14:44:34 rillig Exp $ */ +/* $NetBSD: c11_generic_expression.c,v 1.16 2023/07/07 00:20:39 rillig Exp $ */ # 3 "c11_generic_expression.c" /* @@ -11,7 +11,7 @@ * C11 6.5.1.1 "Generic selection" */ -/* lint1-extra-flags: -Ac11 -X 351 */ +/* lint1-extra-flags: -Ac11 */ /* * The type of 'var' is not compatible with any of the types from the @@ -101,6 +101,7 @@ primary_expression(void) * which is then silently ignored by init_expr. This situation is already * covered by the compilers, so there is no need for lint to double-check it. */ +/* expect+1: warning: missing 'extern' header declaration for 'x' [351] */ const char *x = _Generic( 1ULL + 1.0f, int: 1 Index: src/tests/usr.bin/xlint/lint1/msg_350.c diff -u src/tests/usr.bin/xlint/lint1/msg_350.c:1.1 src/tests/usr.bin/xlint/lint1/msg_350.c:1.2 --- src/tests/usr.bin/xlint/lint1/msg_350.c:1.1 Sat Jan 21 13:07:22 2023 +++ src/tests/usr.bin/xlint/lint1/msg_350.c Fri Jul 7 00:20:39 2023 @@ -1,8 +1,16 @@ -/* $NetBSD: msg_350.c,v 1.1 2023/01/21 13:07:22 rillig Exp $ */ +/* $NetBSD: msg_350.c,v 1.2 2023/07/07 00:20:39 rillig Exp $ */ # 3 "msg_350.c" // Test for message 350: '_Atomic' requires C11 or later [350] +/* + * The keyword '_Atomic' was added in C11. This test ensures that in C99 + * mode, the parser recognizes the keyword but flags it. + * + * See also: + * c11_atomic.c + */ + /* expect+1: error: '_Atomic' requires C11 or later [350] */ typedef _Atomic int atomic_int; @@ -10,3 +18,13 @@ typedef _Atomic int atomic_int; typedef _Atomic struct { int field; } atomic_struct; + +/* expect+3: error: '_Atomic' requires C11 or later [350] */ +/* expect+2: error: '_Atomic' requires C11 or later [350] */ +double * +atomic_ptr_cmpexch(_Atomic(double *)*ptr_var, _Atomic(double *)new_value) +{ + double *old = *ptr_var; + *ptr_var = new_value; + return old; +}
CVS commit: src/share/misc
Module Name:src Committed By: jschauma Date: Thu Jul 6 21:10:15 UTC 2023 Modified Files: src/share/misc: acronyms.comp Log Message: +CAC - cryptographic access control To generate a diff of this commit: cvs rdiff -u -r1.356 -r1.357 src/share/misc/acronyms.comp Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/misc/acronyms.comp diff -u src/share/misc/acronyms.comp:1.356 src/share/misc/acronyms.comp:1.357 --- src/share/misc/acronyms.comp:1.356 Thu Jun 15 13:11:20 2023 +++ src/share/misc/acronyms.comp Thu Jul 6 21:10:15 2023 @@ -1,4 +1,4 @@ -$NetBSD: acronyms.comp,v 1.356 2023/06/15 13:11:20 jschauma Exp $ +$NetBSD: acronyms.comp,v 1.357 2023/07/06 21:10:15 jschauma Exp $ 3WHS three-way handshake 8VSB 8-state vestigial side band modulation AA anti-aliasing @@ -206,6 +206,7 @@ BW bandwidth BWM block-write mode BUAG big ugly ASCII graphic CA certificate authority +CAC cryptographic access control CACLS change access control lists CAD computer-aided design CAM computer assisted manufacturing
CVS commit: src/share/misc
Module Name:src Committed By: jschauma Date: Thu Jul 6 21:10:15 UTC 2023 Modified Files: src/share/misc: acronyms.comp Log Message: +CAC - cryptographic access control To generate a diff of this commit: cvs rdiff -u -r1.356 -r1.357 src/share/misc/acronyms.comp Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/lib/libexecinfo
Module Name:src Committed By: riastradh Date: Thu Jul 6 20:44:55 UTC 2023 Modified Files: src/tests/lib/libexecinfo: t_sig_backtrace.c Log Message: t_sig_backtrace: Flush stdout before writing to STDOUT_FILENO. Avoids confusing ordering of output. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libexecinfo/t_sig_backtrace.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/lib/libexecinfo/t_sig_backtrace.c diff -u src/tests/lib/libexecinfo/t_sig_backtrace.c:1.6 src/tests/lib/libexecinfo/t_sig_backtrace.c:1.7 --- src/tests/lib/libexecinfo/t_sig_backtrace.c:1.6 Mon Jul 25 22:43:01 2022 +++ src/tests/lib/libexecinfo/t_sig_backtrace.c Thu Jul 6 20:44:55 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: t_sig_backtrace.c,v 1.6 2022/07/25 22:43:01 riastradh Exp $ */ +/* $NetBSD: t_sig_backtrace.c,v 1.7 2023/07/06 20:44:55 riastradh Exp $ */ /*- * Copyright (c) 2021 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__RCSID("$NetBSD: t_sig_backtrace.c,v 1.6 2022/07/25 22:43:01 riastradh Exp $"); +__RCSID("$NetBSD: t_sig_backtrace.c,v 1.7 2023/07/06 20:44:55 riastradh Exp $"); #include #include @@ -132,6 +132,7 @@ handler(int s) ATF_REQUIRE(size != 0); printf("Backtrace %zd stack frames.\n", size); + fflush(stdout); backtrace_symbols_fd(array, size, STDOUT_FILENO); char **strings = backtrace_symbols_fmt(array, size, "%n");
CVS commit: src/tests/lib/libexecinfo
Module Name:src Committed By: riastradh Date: Thu Jul 6 20:44:55 UTC 2023 Modified Files: src/tests/lib/libexecinfo: t_sig_backtrace.c Log Message: t_sig_backtrace: Flush stdout before writing to STDOUT_FILENO. Avoids confusing ordering of output. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libexecinfo/t_sig_backtrace.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/xlint/common
Module Name:src Committed By: rillig Date: Thu Jul 6 07:59:00 UTC 2023 Modified Files: src/usr.bin/xlint/common: externs.h lint.h Log Message: lint: add type safety for accessing properties of basic types No functional change. To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/usr.bin/xlint/common/externs.h cvs rdiff -u -r1.38 -r1.39 src/usr.bin/xlint/common/lint.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/common/externs.h diff -u src/usr.bin/xlint/common/externs.h:1.27 src/usr.bin/xlint/common/externs.h:1.28 --- src/usr.bin/xlint/common/externs.h:1.27 Thu Jun 29 10:31:32 2023 +++ src/usr.bin/xlint/common/externs.h Thu Jul 6 07:59:00 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: externs.h,v 1.27 2023/06/29 10:31:32 rillig Exp $ */ +/* $NetBSD: externs.h,v 1.28 2023/07/06 07:59:00 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -34,8 +34,10 @@ /* * tyname.c */ +#if defined(IS_LINT1) || defined(IS_LINT2) const char *type_name(const type_t *); -const char *tspec_name(tspec_t); +const char *tspec_name(tspec_t); +#endif /* * mem.c Index: src/usr.bin/xlint/common/lint.h diff -u src/usr.bin/xlint/common/lint.h:1.38 src/usr.bin/xlint/common/lint.h:1.39 --- src/usr.bin/xlint/common/lint.h:1.38 Mon Jul 3 07:03:19 2023 +++ src/usr.bin/xlint/common/lint.h Thu Jul 6 07:59:00 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: lint.h,v 1.38 2023/07/03 07:03:19 rillig Exp $ */ +/* $NetBSD: lint.h,v 1.39 2023/07/06 07:59:00 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -47,6 +47,7 @@ #include "param.h" +#if defined(IS_LINT1) || defined(IS_LINT2) /* * Type specifiers, used in type structures (type_t) and elsewhere. */ @@ -110,20 +111,23 @@ typedef struct { const char *tt_name; /* name of the type */ } ttab_t; -#define size_in_bits(t) (ttab[t].tt_size_in_bits) -#define portable_size_in_bits(t) (ttab[t].tt_portable_size_in_bits) -#define signed_type(t) (ttab[t].tt_signed_counterpart) -#define unsigned_type(t) (ttab[t].tt_unsigned_counterpart) -#define is_integer(t) (ttab[t].tt_is_integer) -#define is_uinteger(t) (ttab[t].tt_is_uinteger) -#define is_floating(t) (ttab[t].tt_is_floating) -#define is_arithmetic(t) (ttab[t].tt_is_arithmetic) -#define is_complex(t) (ttab[t].tt_is_complex) -#define is_scalar(t) (ttab[t].tt_is_scalar) - -#if defined(IS_LINT1) || defined(IS_LINT2) extern ttab_t ttab[]; -#endif + +static inline const ttab_t * +type_properties(tspec_t t) { + return ttab + t; +} + +#define size_in_bits(t) (type_properties(t)->tt_size_in_bits) +#define portable_size_in_bits(t) (type_properties(t)->tt_portable_size_in_bits) +#define signed_type(t) (type_properties(t)->tt_signed_counterpart) +#define unsigned_type(t) (type_properties(t)->tt_unsigned_counterpart) +#define is_integer(t) (type_properties(t)->tt_is_integer) +#define is_uinteger(t) (type_properties(t)->tt_is_uinteger) +#define is_floating(t) (type_properties(t)->tt_is_floating) +#define is_arithmetic(t) (type_properties(t)->tt_is_arithmetic) +#define is_complex(t) (type_properties(t)->tt_is_complex) +#define is_scalar(t) (type_properties(t)->tt_is_scalar) typedef enum { @@ -146,6 +150,7 @@ typedef struct lint1_type type_t; #else typedef struct lint2_type type_t; #endif +#endif #include "externs.h"
CVS commit: src/usr.bin/xlint/common
Module Name:src Committed By: rillig Date: Thu Jul 6 07:59:00 UTC 2023 Modified Files: src/usr.bin/xlint/common: externs.h lint.h Log Message: lint: add type safety for accessing properties of basic types No functional change. To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/usr.bin/xlint/common/externs.h cvs rdiff -u -r1.38 -r1.39 src/usr.bin/xlint/common/lint.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Thu Jul 6 07:33:36 UTC 2023 Modified Files: src/tests/usr.bin/xlint/lint1: check-expect.lua msg_247_lp64_ldbl128.c Log Message: tests/lint: ensure consistent preprocessor filenames in tests The deviations often happen when copying or renaming tests. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/check-expect.lua cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_247_lp64_ldbl128.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/lint1/check-expect.lua diff -u src/tests/usr.bin/xlint/lint1/check-expect.lua:1.4 src/tests/usr.bin/xlint/lint1/check-expect.lua:1.5 --- src/tests/usr.bin/xlint/lint1/check-expect.lua:1.4 Sat Jul 1 09:21:31 2023 +++ src/tests/usr.bin/xlint/lint1/check-expect.lua Thu Jul 6 07:33:36 2023 @@ -1,5 +1,5 @@ #! /usr/bin/lua --- $NetBSD: check-expect.lua,v 1.4 2023/07/01 09:21:31 rillig Exp $ +-- $NetBSD: check-expect.lua,v 1.5 2023/07/06 07:33:36 rillig Exp $ --[[ @@ -91,6 +91,10 @@ local function load_c(fname) print_error("error: %s:%d: preprocessor line number must be %d", fname, phys_lineno, phys_lineno + 1) end + if ppl_fname:match("%.c$") and ppl_fname ~= basename then +print_error("error: %s:%d: preprocessor filename must be '%s'", + fname, phys_lineno, basename) + end pp_fname = ppl_fname pp_lineno = ppl_lineno end @@ -104,7 +108,7 @@ end -- -- example return value: { -- { --- exp_lineno = "18", +-- exp_lineno = 18, -- location = "file.c(18)", -- message = "not a constant expression [123]", -- } Index: src/tests/usr.bin/xlint/lint1/msg_247_lp64_ldbl128.c diff -u src/tests/usr.bin/xlint/lint1/msg_247_lp64_ldbl128.c:1.2 src/tests/usr.bin/xlint/lint1/msg_247_lp64_ldbl128.c:1.3 --- src/tests/usr.bin/xlint/lint1/msg_247_lp64_ldbl128.c:1.2 Wed Jul 5 11:42:14 2023 +++ src/tests/usr.bin/xlint/lint1/msg_247_lp64_ldbl128.c Thu Jul 6 07:33:36 2023 @@ -1,5 +1,5 @@ -/* $NetBSD: msg_247_lp64_ldbl128.c,v 1.2 2023/07/05 11:42:14 rillig Exp $ */ -# 3 "msg_247_lp64.c" +/* $NetBSD: msg_247_lp64_ldbl128.c,v 1.3 2023/07/06 07:33:36 rillig Exp $ */ +# 3 "msg_247_lp64_ldbl128.c" // Test for message: pointer cast from '%s' to '%s' may be troublesome [247]
CVS commit: src/tests/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Thu Jul 6 07:33:36 UTC 2023 Modified Files: src/tests/usr.bin/xlint/lint1: check-expect.lua msg_247_lp64_ldbl128.c Log Message: tests/lint: ensure consistent preprocessor filenames in tests The deviations often happen when copying or renaming tests. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/check-expect.lua cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_247_lp64_ldbl128.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.