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: document why lint does...



details:   https://anonhg.NetBSD.org/src/rev/f49abb86aad9
branches:  trunk
changeset: 984940:f49abb86aad9
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Aug 01 13:09:38 2021 +0000

description:
tests/lint: document why lint does not check _Generic selections

diffstat:

 tests/usr.bin/xlint/lint1/c11_generic_expression.c |  12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diffs (23 lines):

diff -r 57e0219cffdf -r f49abb86aad9 tests/usr.bin/xlint/lint1/c11_generic_expression.c
--- a/tests/usr.bin/xlint/lint1/c11_generic_expression.c        Sun Aug 01 08:03:43 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/c11_generic_expression.c        Sun Aug 01 13:09:38 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: c11_generic_expression.c,v 1.8 2021/07/11 20:37:21 rillig Exp $        */
+/*     $NetBSD: c11_generic_expression.c,v 1.9 2021/08/01 13:09:38 rillig Exp $        */
 # 3 "c11_generic_expression.c"
 
 /*
@@ -94,3 +94,13 @@
 {
        return _Generic(0, int: assignment_expression)(0, 0);
 }
+
+/*
+ * The types don't match, therefore build_generic_selection returns NULL,
+ * 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.
+ */
+const char *x = _Generic(
+    (__uint128_t)1 + 1.0f,
+    int: 1
+);



Home | Main Index | Thread Index | Old Index