Module Name: src
Committed By: rillig
Date: Sat Jan 28 00:46:14 UTC 2023
Modified Files:
src/usr.bin/xlint/lint1: tree.c
Log Message:
lint: use stronger wording in comments of unimplemented offsetof
To generate a diff of this commit:
cvs rdiff -u -r1.497 -r1.498 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.497 src/usr.bin/xlint/lint1/tree.c:1.498
--- src/usr.bin/xlint/lint1/tree.c:1.497 Sat Jan 28 00:39:49 2023
+++ src/usr.bin/xlint/lint1/tree.c Sat Jan 28 00:46:14 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: tree.c,v 1.497 2023/01/28 00:39:49 rillig Exp $ */
+/* $NetBSD: tree.c,v 1.498 2023/01/28 00:46:14 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID)
-__RCSID("$NetBSD: tree.c,v 1.497 2023/01/28 00:39:49 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.498 2023/01/28 00:46:14 rillig Exp $");
#endif
#include <float.h>
@@ -3785,7 +3785,7 @@ build_sizeof(const type_t *tp)
/*
* Create a constant node for offsetof.
*/
-/* ARGSUSED */ /* See implementation comments. */
+/* ARGSUSED */ /* FIXME: See implementation comments. */
tnode_t *
build_offsetof(const type_t *tp, const sym_t *sym)
{
@@ -3796,7 +3796,7 @@ build_offsetof(const type_t *tp, const s
/* unacceptable operand of '%s' */
error(111, "offsetof");
- /* XXX: wrong size, no checking for sym fixme */
+ /* FIXME: Don't wrongly use the size of the whole type, use sym. */
offset_in_bytes = type_size_in_bits(tp) / CHAR_SIZE;
tn = build_integer_constant(SIZEOF_TSPEC, offset_in_bytes);
tn->tn_system_dependent = true;