Skip to content

Commit d5d4863

Browse files
author
ripley
committed
add a test that claimed C23 supports the bool keyword
warn if --with-C23 is used and no C23 compiler is found. git-svn-id: https://svn.r-project.org/R/trunk@87677 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent be2890f commit d5d4863

File tree

3 files changed

+31
-6
lines changed

3 files changed

+31
-6
lines changed

configure

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8121,7 +8121,11 @@ else case e in #(
81218121
# error "Compiler does not advertise ISO C conformance"
81228122
#endif
81238123

8124+
// Most new features have feature tests. but bool type is fundamental.
8125+
81248126
int main(void) {
8127+
bool x = true;
8128+
81258129
return 0;
81268130
}
81278131

@@ -8169,7 +8173,11 @@ else case e in #(
81698173
# error "Compiler does not advertise ISO C conformance"
81708174
#endif
81718175

8176+
// Most new features have feature tests. but bool type is fundamental.
8177+
81728178
int main(void) {
8179+
bool x = true;
8180+
81738181
return 0;
81748182
}
81758183

@@ -8201,8 +8209,15 @@ fi
82018209

82028210

82038211
if test x$use_C23 = xyes; then
8204-
CC=${CC23}
8205-
CFLAGS=${C23FLAGS}
8212+
if test x${r_cv_C23} = xyes; then
8213+
CC=${CC23}
8214+
CFLAGS=${C23FLAGS}
8215+
else
8216+
CC=${CC_save}
8217+
CFLAGS=${CFLAGS_save}
8218+
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: C23 support is unavailable" >&5
8219+
printf "%s\n" "$as_me: WARNING: C23 support is unavailable" >&2;}
8220+
fi
82068221
else
82078222
CC=${CC_save}
82088223
CFLAGS=${CFLAGS_save}
@@ -27514,7 +27529,7 @@ _ACEOF
2751427529
# flags.
2751527530
r_save_CFLAGS=$CFLAGS
2751627531
CFLAGS="$CFLAGS $r_verb"
27517-
(eval echo $as_me:27517: \"$ac_link\") >&5
27532+
(eval echo $as_me:27532: \"$ac_link\") >&5
2751827533
r_c_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
2751927534
echo "$r_c_v_output" >&5
2752027535
CFLAGS=$r_save_CFLAGS
@@ -27592,7 +27607,7 @@ _ACEOF
2759227607
# flags.
2759327608
r_save_CFLAGS=$CFLAGS
2759427609
CFLAGS="$CFLAGS $r_cv_prog_c_v"
27595-
(eval echo $as_me:27595: \"$ac_link\") >&5
27610+
(eval echo $as_me:27610: \"$ac_link\") >&5
2759627611
r_c_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
2759727612
echo "$r_c_v_output" >&5
2759827613
CFLAGS=$r_save_CFLAGS

configure.ac

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -777,8 +777,14 @@ AC_SUBST(CC23)
777777
AC_SUBST(C23FLAGS)
778778

779779
if test x$use_C23 = xyes; then
780-
CC=${CC23}
781-
CFLAGS=${C23FLAGS}
780+
if test x${r_cv_C23} = xyes; then
781+
CC=${CC23}
782+
CFLAGS=${C23FLAGS}
783+
else
784+
CC=${CC_save}
785+
CFLAGS=${CFLAGS_save}
786+
AC_MSG_WARN([C23 support is unavailable])
787+
fi
782788
else
783789
CC=${CC_save}
784790
CFLAGS=${CFLAGS_save}

m4/R.m4

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5370,7 +5370,11 @@ AC_DEFUN([R_C23],
53705370
# error "Compiler does not advertise ISO C conformance"
53715371
#endif
53725372
5373+
// Most new features have feature tests. but bool type is fundamental.
5374+
53735375
int main(void) {
5376+
bool x = true;
5377+
53745378
return 0;
53755379
}
53765380

0 commit comments

Comments
 (0)