Skip to content

Commit

Permalink
add a test that claimed C23 supports the bool keyword
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ripley committed Feb 3, 2025
1 parent be2890f commit d5d4863
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
23 changes: 19 additions & 4 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -8121,7 +8121,11 @@ else case e in #(
# error "Compiler does not advertise ISO C conformance"
#endif

// Most new features have feature tests. but bool type is fundamental.

int main(void) {
bool x = true;

return 0;
}

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

// Most new features have feature tests. but bool type is fundamental.

int main(void) {
bool x = true;

return 0;
}

Expand Down Expand Up @@ -8201,8 +8209,15 @@ fi


if test x$use_C23 = xyes; then
CC=${CC23}
CFLAGS=${C23FLAGS}
if test x${r_cv_C23} = xyes; then
CC=${CC23}
CFLAGS=${C23FLAGS}
else
CC=${CC_save}
CFLAGS=${CFLAGS_save}
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: C23 support is unavailable" >&5
printf "%s\n" "$as_me: WARNING: C23 support is unavailable" >&2;}
fi
else
CC=${CC_save}
CFLAGS=${CFLAGS_save}
Expand Down Expand Up @@ -27514,7 +27529,7 @@ _ACEOF
# flags.
r_save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $r_verb"
(eval echo $as_me:27517: \"$ac_link\") >&5
(eval echo $as_me:27532: \"$ac_link\") >&5
r_c_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
echo "$r_c_v_output" >&5
CFLAGS=$r_save_CFLAGS
Expand Down Expand Up @@ -27592,7 +27607,7 @@ _ACEOF
# flags.
r_save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $r_cv_prog_c_v"
(eval echo $as_me:27595: \"$ac_link\") >&5
(eval echo $as_me:27610: \"$ac_link\") >&5
r_c_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
echo "$r_c_v_output" >&5
CFLAGS=$r_save_CFLAGS
Expand Down
10 changes: 8 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -777,8 +777,14 @@ AC_SUBST(CC23)
AC_SUBST(C23FLAGS)

if test x$use_C23 = xyes; then
CC=${CC23}
CFLAGS=${C23FLAGS}
if test x${r_cv_C23} = xyes; then
CC=${CC23}
CFLAGS=${C23FLAGS}
else
CC=${CC_save}
CFLAGS=${CFLAGS_save}
AC_MSG_WARN([C23 support is unavailable])
fi
else
CC=${CC_save}
CFLAGS=${CFLAGS_save}
Expand Down
4 changes: 4 additions & 0 deletions m4/R.m4
Original file line number Diff line number Diff line change
Expand Up @@ -5370,7 +5370,11 @@ AC_DEFUN([R_C23],
# error "Compiler does not advertise ISO C conformance"
#endif
// Most new features have feature tests. but bool type is fundamental.
int main(void) {
bool x = true;
return 0;
}
Expand Down

0 comments on commit d5d4863

Please sign in to comment.