Module Name: src
Committed By: rillig
Date: Thu Apr 1 15:06:50 UTC 2021
Modified Files:
src/usr.bin/xlint/lint1: tree.c
Log Message:
lint: remove wrong assumption from comment
The size in bits of a struct or union is not measured at all at this
point since portable_size_in_bits only takes the broad type
classification (tspec_t), not the precise type information (type_t).
No functional change.
To generate a diff of this commit:
cvs rdiff -u -r1.254 -r1.255 src/usr.bin/xlint/lint1/tree.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.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.254 src/usr.bin/xlint/lint1/tree.c:1.255
--- src/usr.bin/xlint/lint1/tree.c:1.254 Tue Mar 30 15:18:19 2021
+++ src/usr.bin/xlint/lint1/tree.c Thu Apr 1 15:06:49 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: tree.c,v 1.254 2021/03/30 15:18:19 rillig Exp $ */
+/* $NetBSD: tree.c,v 1.255 2021/04/01 15:06:49 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.254 2021/03/30 15:18:19 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.255 2021/04/01 15:06:49 rillig Exp $");
#endif
#include <float.h>
@@ -2233,10 +2233,6 @@ should_warn_about_pointer_cast(const typ
if (nst == CHAR || nst == UCHAR)
return false; /* for the sake of traditional C code */
- /*
- * XXX: Why should it be ok to cast between arbitrary structs that
- * just happen to be of the same size?
- */
return portable_size_in_bits(nst) != portable_size_in_bits(ost);
}