Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/xlint/common lint: fix bit-size of long double _Comp...



details:   https://anonhg.NetBSD.org/src/rev/1a27ddde0784
branches:  trunk
changeset: 380000:1a27ddde0784
user:      rillig <rillig%NetBSD.org@localhost>
date:      Wed Jun 30 10:56:24 2021 +0000

description:
lint: fix bit-size of long double _Complex in portable mode

C99 6.2.5p13 says that LCOMPLEX has the same representation and
alignment requirements as an array type containing exactly two LDOUBLE.

When support for _Complex was added to lint in inittyp.c 1.10 from
2008-09-27, there was no explanation for making the bit-size of LCOMPLEX
different from what C99 says, so it was probably a mistake that went
unnoticed for more than 12 years.  It's an edge case anyway.

diffstat:

 usr.bin/xlint/common/inittyp.c |  11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diffs (33 lines):

diff -r 9f146fcc6119 -r 1a27ddde0784 usr.bin/xlint/common/inittyp.c
--- a/usr.bin/xlint/common/inittyp.c    Wed Jun 30 10:25:02 2021 +0000
+++ b/usr.bin/xlint/common/inittyp.c    Wed Jun 30 10:56:24 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: inittyp.c,v 1.23 2021/06/29 21:33:09 rillig Exp $      */
+/*     $NetBSD: inittyp.c,v 1.24 2021/06/30 10:56:24 rillig Exp $      */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: inittyp.c,v 1.23 2021/06/29 21:33:09 rillig Exp $");
+__RCSID("$NetBSD: inittyp.c,v 1.24 2021/06/30 10:56:24 rillig Exp $");
 #endif
 
 #include <limits.h>
@@ -115,13 +115,8 @@ inittyp(void)
                    0, 0, 1, 1, 1, 1, "float _Complex"),
                typeinfo(DCOMPLEX, DCOMPLEX, DCOMPLEX, DOUBLE_SIZE * 2, 64 * 2,
                    0, 0, 1, 1, 1, 1, "double _Complex"),
-               /*
-               * XXX: with -p, LCOMPLEX.tt_portable_size_in_bits !=
-               *  2 * LDOUBLE.tt_portable_size_in_bits.
-               *  This may or may not have been intentional.
-               */
                typeinfo(LCOMPLEX, LCOMPLEX, LCOMPLEX,
-                   LDOUBLE_SIZE * 2, 64 * 2,
+                   LDOUBLE_SIZE * 2, 80 * 2,
                    0, 0, 1, 1, 1, 1, "long double _Complex"),
                typeinfo(VOID, VOID, VOID, -1, -1,
                    0, 0, 0, 0, 0, 0, "void"),



Home | Main Index | Thread Index | Old Index