Module Name:    src
Committed By:   christos
Date:           Thu May 12 17:31:30 UTC 2022

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

Log Message:
gcc allows __alignof__(unary-expression)


To generate a diff of this commit:
cvs rdiff -u -r1.411 -r1.412 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.164 -r1.165 src/usr.bin/xlint/lint1/err.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/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.411 src/usr.bin/xlint/lint1/cgram.y:1.412
--- src/usr.bin/xlint/lint1/cgram.y:1.411	Wed May 11 20:28:01 2022
+++ src/usr.bin/xlint/lint1/cgram.y	Thu May 12 13:31:30 2022
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.411 2022/05/12 00:28:01 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.412 2022/05/12 17:31:30 christos 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.411 2022/05/12 00:28:01 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.412 2022/05/12 17:31:30 christos Exp $");
 #endif
 
 #include <limits.h>
@@ -618,6 +618,12 @@ unary_expression:
 			check_expr_misc($2,
 			    false, false, false, false, false, true);
 	  }
+	/* gcc */
+	| T_ALIGNOF T_LPAREN unary_expression T_RPAREN {
+		gnuism(349);
+		if ($3 != NULL)
+			$$ = build_alignof($3->tn_type);
+	  }
 	| T_SIZEOF T_LPAREN type_name T_RPAREN {
 		$$ = build_sizeof($3);
 	  }

Index: src/usr.bin/xlint/lint1/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.164 src/usr.bin/xlint/lint1/err.c:1.165
--- src/usr.bin/xlint/lint1/err.c:1.164	Sat Apr 30 18:31:23 2022
+++ src/usr.bin/xlint/lint1/err.c	Thu May 12 13:31:30 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: err.c,v 1.164 2022/04/30 22:31:23 rillig Exp $	*/
+/*	$NetBSD: err.c,v 1.165 2022/05/12 17:31:30 christos 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.164 2022/04/30 22:31:23 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.165 2022/05/12 17:31:30 christos Exp $");
 #endif
 
 #include <sys/types.h>
@@ -403,6 +403,7 @@ const char *const msgs[] = {
 	"call to '%s' effectively discards 'const' from argument",    /* 346 */
 	"redeclaration of '%s' with type '%s', expected '%s'",	      /* 347 */
 	"maximum value %d of '%s' does not match maximum array index %d", /* 348 */
+	"non type argument to alignof is a GCC extension",	      /* 349 */
 };
 
 static struct include_level {

Reply via email to