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 conversion fr...



details:   https://anonhg.NetBSD.org/src/rev/ec96ef84051e
branches:  trunk
changeset: 373060:ec96ef84051e
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jan 15 14:00:09 2023 +0000

description:
tests/lint: document conversion from void pointer

diffstat:

 tests/usr.bin/xlint/lint1/queries.c |  8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diffs (22 lines):

diff -r 460ea96364ee -r ec96ef84051e tests/usr.bin/xlint/lint1/queries.c
--- a/tests/usr.bin/xlint/lint1/queries.c       Sun Jan 15 13:55:06 2023 +0000
+++ b/tests/usr.bin/xlint/lint1/queries.c       Sun Jan 15 14:00:09 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: queries.c,v 1.8 2023/01/08 18:37:12 rillig Exp $       */
+/*     $NetBSD: queries.c,v 1.9 2023/01/15 14:00:09 rillig Exp $       */
 # 3 "queries.c"
 
 /*
@@ -247,6 +247,12 @@
        c64 = (c64_t)f32;
 
 
+       /*
+        * Converting a void pointer type to an object pointer type requires
+        * an explicit cast in C++, as it is a narrowing conversion. In C,
+        * that conversion is done implicitly.
+        */
+
        /* expect+1: redundant cast from 'pointer to void' to 'pointer to char' before assignment [Q7] */
        str = (char *)allocate();
        /* expect+1: redundant cast from 'pointer to void' to 'pointer to const char' before assignment [Q7] */



Home | Main Index | Thread Index | Old Index