Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/usr.bin/xlint/lint1 tests/lint: demonstrate wrong 'syn...



details:   https://anonhg.NetBSD.org/src/rev/fb6b1e67482c
branches:  trunk
changeset: 1022878:fb6b1e67482c
user:      rillig <rillig%NetBSD.org@localhost>
date:      Wed Aug 11 05:08:35 2021 +0000

description:
tests/lint: demonstrate wrong 'syntax error' for unused argument

Seen in pam_chroot.c:60.

diffstat:

 tests/usr.bin/xlint/lint1/gcc_attribute_var.c   |  11 ++++++++++-
 tests/usr.bin/xlint/lint1/gcc_attribute_var.exp |   3 ++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diffs (33 lines):

diff -r 3193e60f1e4d -r fb6b1e67482c tests/usr.bin/xlint/lint1/gcc_attribute_var.c
--- a/tests/usr.bin/xlint/lint1/gcc_attribute_var.c     Tue Aug 10 20:43:12 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/gcc_attribute_var.c     Wed Aug 11 05:08:35 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gcc_attribute_var.c,v 1.3 2021/07/11 15:07:39 rillig Exp $     */
+/*     $NetBSD: gcc_attribute_var.c,v 1.4 2021/08/11 05:08:35 rillig Exp $     */
 # 3 "gcc_attribute_var.c"
 
 /*
@@ -63,6 +63,15 @@
        }
 }
 
+void
+attribute_after_array_brackets(
+    /* FIXME: GCC accepts this */
+    /* expect+1: error: syntax error '__attribute__' [249] */
+    const char *argv[] __attribute__((__unused__))
+)
+{
+}
+
 /* just to trigger _some_ error, to keep the .exp file */
 /* expect+1: error: syntax error 'syntax_error' [249] */
 __attribute__((syntax_error));
diff -r 3193e60f1e4d -r fb6b1e67482c tests/usr.bin/xlint/lint1/gcc_attribute_var.exp
--- a/tests/usr.bin/xlint/lint1/gcc_attribute_var.exp   Tue Aug 10 20:43:12 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/gcc_attribute_var.exp   Wed Aug 11 05:08:35 2021 +0000
@@ -1,2 +1,3 @@
 gcc_attribute_var.c(59): warning: 'var2' unused in function 'ambiguity_for_attribute' [192]
-gcc_attribute_var.c(68): error: syntax error 'syntax_error' [249]
+gcc_attribute_var.c(70): error: syntax error '__attribute__' [249]
+gcc_attribute_var.c(77): error: syntax error 'syntax_error' [249]



Home | Main Index | Thread Index | Old Index