Project

General

Profile

Actions

Bug #21340

closed

Bump autoconf version to properly handle C23 bool/stdbool defines

Added by christo (Chris Alberti) about 20 hours ago. Updated about 12 hours ago.

Status:
Feedback
Assignee:
-
Target version:
-
ruby -v:
3.4.3, 3.5.0, any built with GCC 15 (so C23)
[ruby-core:122101]

Description

Right now if I install a recent release using rbenv or asdf, or manually download the latest release 3.4.3 or the preview 3.5.0, the included ./configure seems to have been generated by an old version of autoconf. After running ./configure, I end up with a config.h containing HAVE__BOOL = 1, but not containing HAVE_STD_BOOL_H = 1.

If I grab the source from github (latest, or 3.4.3 tag) and run autoconf myself (I'm currently on 2.72), I get a config.h with both HAVE__BOOL = 1 and HAVE_STD_BOOL_H = 1 defined.

This ends up meaning that in the official releases, Ruby's internal/stdbool.h skips using <stdbool.h> and moves on to defining bool/true/false itself.

This is not valid as of C23 (which is now default in GCC 15). On my end I found this because I was seeing build failures in the geoip2_compat gem related to issues with the bool type definition on GCC 15. I submitted a patch to the gem's repo for a workaround (include <stdbool.h> before ruby.h), but this might come back to bite other native extension gem compiles as well.

It looks like autoconf was patched to fix the HAVE_STD_BOOL_H define for C23 in this commit.

I can tell that the ./configure included in the official ruby releases was created with an older version of autoconf because I still see the line:

Check for stdbool.h that conforms to C99

rather than the updated version (which appears in my ./configure created with autoconf 2.72)

Check for stdbool.h that conforms to C99 or later

I'd happily submit a PR if the setup around packaging the official releases is public and someone can point me to it! I wasn't able to find it on a quick search.

Updated by nobu (Nobuyoshi Nakada) about 12 hours ago

  • Status changed from Open to Feedback

Isn't HAVE_STDBOOL_H defined?
HAVE_STD_BOOL_H should be for std_bool.h.

Actions

Also available in: Atom PDF

Like0
Like0