Skip to content

Fix GH-20491: SLES15 compile error with mbstring oniguruma - #20499

Closed
ndossche wants to merge 1 commit into
php:PHP-8.3from
ndossche:mbstring-20491
Closed

ndossche wants to merge 1 commit into
php:PHP-8.3from
ndossche:mbstring-20491

Conversation

@ndossche

@ndossche ndossche commented Nov 16, 2025 •

Copy link
Copy Markdown
Member

The issue is specific to SLES15.
Arguably this should be reported to them as it seems to me they meddled with the oniguruma source code.

The definition in oniguruma.h on that platform looks like this (same as upstream):

ONIG_EXTERN
int onig_error_code_to_str PV_((OnigUChar* s, int err_code, ...));

Where PV_ is defined as (differs):

#ifndef PV_
#ifdef HAVE_STDARG_PROTOTYPES
# define PV_(args) args
#else
# define PV_(args) ()
#endif
#endif

So that means that HAVE_STDARG_PROTOTYPES is unset. This can be set if we define HAVE_STDARG_H,
which we can do because PHP requires at least C99 in which the header is always available.
We could also use an autoconf check, but this isn't really necessary as it will always succeed.

The issue is specific to SLES15.
Arguably this should be reported to them as it seems to me they meddled
with the oniguruma source code.

The definition in oniguruma.h on that platform looks like this (same as upstream):
```c
ONIG_EXTERN
int onig_error_code_to_str PV_((OnigUChar* s, int err_code, ...));
```

Where `PV_` is defined as (differs):
```c
```

So that means that `HAVE_STDARG_PROTOTYPES` is unset.
This can be set if we define `HAVE_STDARG_H`,
which we can do because PHP requires at least C99 in which the header
is always available.
We could also use an autoconf check, but this isn't really necessary as
it will always succeed.
@ndossche ndossche linked an issue Nov 16, 2025 that may be closed by this pull request
@ndossche ndossche linked an issue Nov 16, 2025 that may be closed by this pull request

@youkidearitai youkidearitai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My local environment is good. So looks good to me.

@devnexen devnexen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it had worked for the OP anyway

@ndossche

Copy link
Copy Markdown
Member Author

Merged via a1912e3

@ndossche ndossche closed this Nov 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SLES15 compile error with mbstring oniguruma

3 participants