[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Amend AC_CHECK_HEADER_STDBOOL for C++11 and modern dialects
From: |
David Seifert |
Subject: |
Re: [PATCH] Amend AC_CHECK_HEADER_STDBOOL for C++11 and modern dialects |
Date: |
Fri, 03 Jun 2016 22:32:51 +0200 |
On Do, 2016-06-02 at 15:01 -0700, Paul Eggert wrote:
> On 06/02/2016 02:26 PM, David Seifert wrote:
> >
> > We could relax the whole thing a bit, and maybe just make a plain
> > __cplusplus check, without a version number. This keeps the C side
> > as
> > it always has been, but allows C++'s proper literals to kick in.
> >
> > In addition, _Bool is also a major obstacle, as it does not exist
> > in
> > C++ (and does so only for GCC due to some GNUisms in libstdc++ with
> > -std=c++98). Would you consider moving away from _Bool and
> > replacing
> > all uses of it with bool? After all, <stdbool.h> by itself only
> > mandates the existence of bool/true/false.
> Sure, that all sounds fine (in C++ only of course).
Dear Paul,
attached the patch. I believe this patch in fact increases strictness
even for C code, as it relies on the proper functioning of the "bool"
macro. I have tested it with multiple C and C++ compilers on OS X and
Linux:
OS X (current stdbool.m4):
CC = gcc-apple-4.2
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
CC = gcc-mp-5
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
CC = gcc-mp-6
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
CC = clang-mp-3.7
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
CC = g++-apple-4.2
checking for stdbool.h that conforms to C99... yes
checking for _Bool... no
CC = g++-mp-5
checking for stdbool.h that conforms to C99... yes
checking for _Bool... no
CC = g++-mp-6
checking for stdbool.h that conforms to C99... yes
checking for _Bool... no
CC = clang++-mp-3.7
checking for stdbool.h that conforms to C99... no
checking for _Bool... no
OS X (new stdbool.m4):
C = gcc-apple-4.2
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
CC = gcc-mp-5
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
CC = gcc-mp-6
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
CC = clang-mp-3.7
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
CC = g++-apple-4.2
checking for stdbool.h that conforms to C99... yes
checking for _Bool... no
CC = g++-mp-5
checking for stdbool.h that conforms to C99... yes
checking for _Bool... no
CC = g++-mp-6
checking for stdbool.h that conforms to C99... yes
checking for _Bool... no
CC = clang++-mp-3.7
checking for stdbool.h that conforms to C99... yes
checking for _Bool... no
Linux (current stdbool.m4):
CC = gcc-4.9.3
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
CC = gcc-5.3.0
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
CC = clang-3.8
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
CC = g++-4.9.3
checking for stdbool.h that conforms to C99... yes
checking for _Bool... no
CC = g++-5.3.0
checking for stdbool.h that conforms to C99... yes
checking for _Bool... no
CC = clang++-3.8
checking for stdbool.h that conforms to C99... no
checking for _Bool... no
Linux (new stdbool.m4):
CC = gcc-4.9.3
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
CC = gcc-5.3.0
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
CC = clang-3.8
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
CC = g++-4.9.3
checking for stdbool.h that conforms to C99... yes
checking for _Bool... no
CC = g++-5.3.0
checking for stdbool.h that conforms to C99... yes
checking for _Bool... no
CC = clang++-3.8
checking for stdbool.h that conforms to C99... yes
checking for _Bool... no
As you can see, it works for Clang++ now too.
Regards
David
0001-Make-stdbool.m4-as-compatible-as-possible-for-C.patch
Description: Text Data