1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Autotools, ext/gd: Ensure test program compiles without warnings (#19116)

In case compiler is configured in some strict way it might emit warnings
or even errors in the future if these aren't casted to void.
This commit is contained in:
Peter Kokot
2025-07-13 17:17:14 +02:00
committed by GitHub
parent d40b603856
commit 4d9fc506df

View File

@@ -163,17 +163,22 @@ AC_CACHE_CHECK([for working gdImageCreateFrom$1 in libgd], [php_var],
/* A custom gdErrorMethod */
void exit1(int priority, const char *format, va_list args) {
(void)priority;
(void)format;
(void)args;
_exit(1);
}
/* Override the default gd_error_method with one that
actually causes the program to return an error. */
int main(int argc, char** argv) {
int main(void)
{
m4_if([$1],[Xpm],
[char* f = "test.xpm"],
[FILE* f = NULL]);
gdSetErrorMethod(exit1);
gdImagePtr p = gdImageCreateFrom$1(f);
(void)p;
return 0;
}])],
[AS_VAR_SET([php_var], [yes])],