[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bison-3.1.91 released [beta]
From: |
Akim Demaille |
Subject: |
Re: bison-3.1.91 released [beta] |
Date: |
Tue, 23 Oct 2018 17:18:43 +0200 |
> Le 22 oct. 2018 à 19:10, Derek Clegg <address@hidden> a écrit :
>
> On Oct 22, 2018, at 10:42 AM, Akim Demaille <address@hidden> wrote:
>>
>> Hi Derek!
>>
>>> Le 21 oct. 2018 à 19:43, Derek Clegg <address@hidden> a écrit :
>>>
>>> I’m seeing a minor warning when building bison-3.1.91:
>>>
>>> lib/obstack.c:351:31: warning: incompatible pointer types initializing 'void
>>> (*)(void) __attribute__((noreturn))' with an expression of type
>>> 'void (void)' [-Wincompatible-pointer-types]
>>> __attribute_noreturn__ void (*obstack_alloc_failed_handler) (void)
>>> ...
>>
>> This is coming from gnulib. Could you submit your patch there?
>> I don’t know how they handle _Noreturn.
>>
>> address@hidden
>
> Thanks for the reply; I’ll do that. I’ll note that data/c.m4 has this:
>
> #if !defined _Noreturn \
> && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
> # if defined _MSC_VER && 1200 <= _MSC_VER
> # define _Noreturn __declspec (noreturn)
> # else
> # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
> # endif
> #endif
>
> That makes it into the generated header, and produces the warning
>
> aux/x.h:97:11: error: macro name is a reserved identifier
> [-Werror,-Wreserved-id-macro]
> # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
>
> As this isn’t used anywhere (as far as I can tell), it seems reasonable to
> omit it.
I’ll install this soon. Thanks!
commit b5515215c188a48c0a9956a5cb03ddb951870477
Author: Akim Demaille <address@hidden>
Date: Tue Oct 23 07:12:09 2018 +0200
yacc.c: don't define _Noreturn uselessly
Clang warns:
aux/x.h:97:11: error: macro name is a reserved identifier
[-Werror,-Wreserved-id-macro]
# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
Reported by Derek Clegg.
http://lists.gnu.org/archive/html/bug-bison/2018-10/msg00024.html
* data/c.m4 (b4_attribute_define): Don't define _Noreturn unconditionally.
* data/glr.c: Ask for _Noreturn.
diff --git a/data/c.m4 b/data/c.m4
index 2ec6ceea..2df76e77 100644
--- a/data/c.m4
+++ b/data/c.m4
@@ -204,11 +204,12 @@ m4_define([b4_table_value_equals],
## Compiler issues. ##
## ----------------- ##
-# b4_attribute_define
-# -------------------
-# Provide portable compiler "attributes".
+# b4_attribute_define([noreturn])
+# -------------------------------
+# Provide portable compiler "attributes". If "noreturn" is passed, define
+# _Noreturn.
m4_define([b4_attribute_define],
-[#ifndef YY_ATTRIBUTE
+[[#ifndef YY_ATTRIBUTE
# if (defined __GNUC__ \
&& (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
|| defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
@@ -226,7 +227,7 @@ m4_define([b4_attribute_define],
# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
#endif
-#if !defined _Noreturn \
+]m4_bmatch([$1], [\bnoreturn\b], [[#if !defined _Noreturn \
&& (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
# if defined _MSC_VER && 1200 <= _MSC_VER
# define _Noreturn __declspec (noreturn)
@@ -235,7 +236,7 @@ m4_define([b4_attribute_define],
# endif
#endif
-/* Suppress unused-variable warnings by "using" E. */
+]])[/* Suppress unused-variable warnings by "using" E. */
#if ! defined lint || defined __GNUC__
# define YYUSE(E) ((void) (E))
#else
@@ -260,7 +261,7 @@ m4_define([b4_attribute_define],
#ifndef YY_INITIAL_VALUE
# define YY_INITIAL_VALUE(Value) /* Nothing. */
#endif
-])
+]])
# b4_null_define
diff --git a/data/glr.c b/data/glr.c
index 56788b80..f77da621 100644
--- a/data/glr.c
+++ b/data/glr.c
@@ -311,7 +311,7 @@ static YYLTYPE yyloc_default][]b4_yyloc_default;])[
} while (yyfalse)
#endif
-]b4_attribute_define[
+]b4_attribute_define([noreturn])[
#ifndef YYASSERT
# define YYASSERT(Condition) ((void) ((Condition) || (abort (), 0)))
- bison-3.1.90 released [beta], Akim Demaille, 2018/10/17
- Re: bison-3.1.91 released [beta], Derek Clegg, 2018/10/21
- Re: bison-3.1.91 released [beta], Akim Demaille, 2018/10/22
- Re: bison-3.1.91 released [beta], Akim Demaille, 2018/10/23
- Re: bison-3.1.91 released [beta], Akim Demaille, 2018/10/23
- Re: bison-3.1.91 released [beta], Paul Eggert, 2018/10/23
- Re: bison-3.1.91 released [beta], Akim Demaille, 2018/10/24
- Re: bison-3.1.91 released [beta], Akim Demaille, 2018/10/24