[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: m4 porting to z/OS - gnulib fix - obstack.h
From: |
Bruno Haible |
Subject: |
Re: m4 porting to z/OS - gnulib fix - obstack.h |
Date: |
Mon, 27 Mar 2023 19:08:43 +0200 |
Hello Harithamma,
Harithamma D wrote:
> I am porting m4 to z/OS and came across following compilation error related
> to gnulib:
>
> In file included from ./builtin.c:25:
> In file included from ./m4.h:50:
> ../lib/obstack.h:229:8: error: unknown attribute '_Noreturn' ignored
> [-Werror,-Wunknown-attributes]
> extern __attribute_noreturn__ void (*obstack_alloc_failed_handler) (void);
> ^
> ../lib/obstack.h:156:50: note: expanded from macro '__attribute_noreturn__'
> # define __attribute_noreturn__ __attribute__ ((__noreturn__))
> ^
> /usr/include/le/features.h:791:26: note: expanded from macro '__noreturn__'
> #define __noreturn__ _Noreturn
>
>
> The compile command used is:
>
> source='builtin.c' object='builtin.o' libtool=no \
> DEPDIR=.deps depmode=hp2 /bin/sh ../build-aux/depcomp \
> xlclang -I../lib -I../lib -DNSIG=42 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE
> -D_OPEN_SYS_FILE_EXT=1 -D_AE_BIMODAL=1 -D_ENHANCED_ASCII_EXT=0xFFFFFFFF
> -fanalyzer -fno-common -Wall -Wbad-function-cast -Wdate-time
> -Wdisabled-optimization -Wdouble-promotion -Wextra -Winit-self -Winline
> -Winvalid-pch -Wmissing-declarations -Wmissing-include-dirs
> -Wmissing-prototypes -Wnested-externs -Wnull-dereference
> -Wold-style-definition -Woverlength-strings -Wpacked -Wpointer-arith -Wshadow
> -Wstack-protector -Wstrict-overflow -Wstrict-prototypes -Wuninitialized
> -Wunknown-pragmas -Wvariadic-macros -Wwrite-strings -Wformat=2
> -Wno-missing-field-initializers -Werror -qascii -std=gnu11 -qnocsect
> -qenum=int -qgonumber -O3 -std=c11 -fgnu89-inline
> -I/home/haritha/code/m4port/m4/lib
> -I/home/haritha/code/m4port/patches/PR1/include -c -o builtin.o builtin.c
>
> The above error got fixed when I added the ! defined (__MVS__) condition as
> shown in diff file attached.
> I would like to upstream these changes. Please let me know if you have any
> concerns or questions.
Before doing that:
Since xlclang is, AFAIU, a copy of clang modified by IBM, and clang supports
__attribute__((__noreturn__)),
see https://clang.llvm.org/docs/AttributeReference.html#id20 ,
it would be more future-oriented if xlclang would support this attribute.
Can you please check with the relevant people in your company whether this
is a possible course of action?
I would prefer to deal with this in Gnulib only if the answer is "no".
Bruno