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 gcc allows __alignof__(unary-expression)



details:   https://anonhg.NetBSD.org/src/rev/11edb51ee7e7
branches:  trunk
changeset: 366056:11edb51ee7e7
user:      christos <christos%NetBSD.org@localhost>
date:      Thu May 12 17:31:30 2022 +0000

description:
gcc allows __alignof__(unary-expression)

diffstat:

 usr.bin/xlint/lint1/cgram.y |  10 ++++++++--
 usr.bin/xlint/lint1/err.c   |   5 +++--
 2 files changed, 11 insertions(+), 4 deletions(-)

diffs (58 lines):

diff -r 18d6f19f7c76 -r 11edb51ee7e7 usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y       Thu May 12 12:05:04 2022 +0000
+++ b/usr.bin/xlint/lint1/cgram.y       Thu May 12 17:31:30 2022 +0000
@@ -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 @@
                        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);
          }
diff -r 18d6f19f7c76 -r 11edb51ee7e7 usr.bin/xlint/lint1/err.c
--- a/usr.bin/xlint/lint1/err.c Thu May 12 12:05:04 2022 +0000
+++ b/usr.bin/xlint/lint1/err.c Thu May 12 17:31:30 2022 +0000
@@ -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 @@
        "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 {



Home | Main Index | Thread Index | Old Index