Module Name:    src
Committed By:   rillig
Date:           Wed Jul 21 21:11:19 UTC 2021

Modified Files:
        src/usr.bin/xlint/lint1: cgram.y

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.331 -r1.332 src/usr.bin/xlint/lint1/cgram.y

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/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.331 src/usr.bin/xlint/lint1/cgram.y:1.332
--- src/usr.bin/xlint/lint1/cgram.y:1.331	Wed Jul 21 21:04:00 2021
+++ src/usr.bin/xlint/lint1/cgram.y	Wed Jul 21 21:11:19 2021
@@ -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 @@ enumerator:			/* C99 6.7.2.2 */
 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);
-		}
 	  }
 	;
 

Reply via email to