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: remove unnecessary assertion for t...



details:   https://anonhg.NetBSD.org/src/rev/5dfcc42ab2fd
branches:  trunk
changeset: 1022486:5dfcc42ab2fd
user:      rillig <rillig%NetBSD.org@localhost>
date:      Wed Jul 21 21:11:19 2021 +0000

description:
lint: remove unnecessary assertion for type qualifier

If there is any new type qualifier that lint should support (such as
_Atomic from C11), the obvious place is to look in the grammar rule
type_qualifier, so there is no need to have an assertion.

No functional change.

diffstat:

 usr.bin/xlint/lint1/cgram.y |  11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diffs (35 lines):

diff -r 034d798d099a -r 5dfcc42ab2fd usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y       Wed Jul 21 21:04:00 2021 +0000
+++ b/usr.bin/xlint/lint1/cgram.y       Wed Jul 21 21:11:19 2021 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.331 2021/07/21 21:04:00 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.332 2021/07/21 21:11:19 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.y,v 1.331 2021/07/21 21:04:00 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.332 2021/07/21 21:11:19 rillig Exp $");
 #endif
 
 #include <limits.h>
@@ -1109,13 +1109,10 @@
 type_qualifier:                        /* C99 6.7.3 */
          T_QUAL {
                $$ = xcalloc(1, sizeof(*$$));
-               if ($1 == CONST) {
+               if ($1 == CONST)
                        $$->p_const = true;
-               } else if ($1 == VOLATILE) {
+               if ($1 == VOLATILE)
                        $$->p_volatile = true;
-               } else {
-                       lint_assert($1 == RESTRICT || $1 == THREAD);
-               }
          }
        ;
 



Home | Main Index | Thread Index | Old Index