Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/xlint/lint1 lint: reword message about bit-field in ...



details:   https://anonhg.NetBSD.org/src/rev/7ec3ccb259a8
branches:  trunk
changeset: 359999:7ec3ccb259a8
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Feb 07 02:44:49 2022 +0000

description:
lint: reword message about bit-field in a union

There is nothing illegal about a bit-field in a union, it is allowed by
C90, C99 and C11.

Fixes PR toolchain/53219.

diffstat:

 tests/usr.bin/xlint/lint1/msg_041.c   |  6 +++---
 tests/usr.bin/xlint/lint1/msg_041.exp |  2 +-
 usr.bin/xlint/lint1/decl.c            |  6 +++---
 usr.bin/xlint/lint1/err.c             |  6 +++---
 4 files changed, 10 insertions(+), 10 deletions(-)

diffs (77 lines):

diff -r c1c0f0a350cc -r 7ec3ccb259a8 tests/usr.bin/xlint/lint1/msg_041.c
--- a/tests/usr.bin/xlint/lint1/msg_041.c       Mon Feb 07 02:39:10 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_041.c       Mon Feb 07 02:44:49 2022 +0000
@@ -1,10 +1,10 @@
-/*     $NetBSD: msg_041.c,v 1.3 2022/02/07 02:39:10 rillig Exp $       */
+/*     $NetBSD: msg_041.c,v 1.4 2022/02/07 02:44:49 rillig Exp $       */
 # 3 "msg_041.c"
 
-// Test for message: illegal use of bit-field [41]
+// Test for message: bit-field in union is very unusual [41]
 
 union u {
        int member;
-       /* expect+1: illegal use of bit-field [41] */
+       /* expect+1: bit-field in union is very unusual [41] */
        unsigned bit_field : 7;
 };
diff -r c1c0f0a350cc -r 7ec3ccb259a8 tests/usr.bin/xlint/lint1/msg_041.exp
--- a/tests/usr.bin/xlint/lint1/msg_041.exp     Mon Feb 07 02:39:10 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_041.exp     Mon Feb 07 02:44:49 2022 +0000
@@ -1,1 +1,1 @@
-msg_041.c(9): warning: illegal use of bit-field [41]
+msg_041.c(9): warning: bit-field in union is very unusual [41]
diff -r c1c0f0a350cc -r 7ec3ccb259a8 usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c        Mon Feb 07 02:39:10 2022 +0000
+++ b/usr.bin/xlint/lint1/decl.c        Mon Feb 07 02:44:49 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.243 2021/12/22 14:25:35 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.244 2022/02/07 02:44:49 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: decl.c,v 1.243 2021/12/22 14:25:35 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.244 2022/02/07 02:44:49 rillig Exp $");
 #endif
 
 #include <sys/param.h>
@@ -1134,7 +1134,7 @@
                tp->t_flen = size_in_bits(t);
        }
        if (dsym->s_scl == MOU) {
-               /* illegal use of bit-field */
+               /* bit-field in union is very unusual */
                warning(41);
                dsym->s_type->t_bitfield = false;
                dsym->s_bitfield = false;
diff -r c1c0f0a350cc -r 7ec3ccb259a8 usr.bin/xlint/lint1/err.c
--- a/usr.bin/xlint/lint1/err.c Mon Feb 07 02:39:10 2022 +0000
+++ b/usr.bin/xlint/lint1/err.c Mon Feb 07 02:44:49 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: err.c,v 1.151 2021/12/22 14:25:35 rillig Exp $ */
+/*     $NetBSD: err.c,v 1.152 2022/02/07 02:44:49 rillig Exp $ */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: err.c,v 1.151 2021/12/22 14:25:35 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.152 2022/02/07 02:44:49 rillig Exp $");
 #endif
 
 #include <sys/types.h>
@@ -95,7 +95,7 @@
        "function illegal in structure or union",                     /* 38 */
        "zero sized array in struct is a C99 extension: %s",          /* 39 */
        "unknown size: %s",                                           /* 40 */
-       "illegal use of bit-field",                                   /* 41 */
+       "bit-field in union is very unusual",                         /* 41 */
        "forward reference to enum type",                             /* 42 */
        "redefinition hides earlier one: %s",                         /* 43 */
        "declaration introduces new type in ANSI C: %s %s",           /* 44 */



Home | Main Index | Thread Index | Old Index