configure: Avoid compiler warnings in getrlimit test
GCC 12 yields a warning when getrlimit from glibc 2.35 is called with a
second parameter being null. We should suppress the warning so the test
succeeds when compiled with the -Werror option.
@@ -1608,11 +1608,17 @@ | ||
1608 | 1608 | #include <stdint.h> /* required before <sys/resource.h> on freebsd */ |
1609 | 1609 | #include <sys/time.h> /* required before <sys/resource.h> on old Mac OS X */ |
1610 | 1610 | #include <sys/resource.h> |
1611 | +int main(void) { | |
1612 | + if (0) { | |
1613 | + struct rlimit r; | |
1614 | + getrlimit(RLIMIT_${i}, &r); | |
1615 | + } | |
1611 | 1616 | #if HAVE_RLIMIT_AS |
1612 | -int main(void) { return RLIMIT_${i} == RLIMIT_AS; getrlimit(RLIMIT_${i}, 0); } | |
1617 | + return RLIMIT_${i} == RLIMIT_AS; | |
1613 | 1618 | #else |
1614 | -int main(void) { return 0; getrlimit(RLIMIT_${i}, 0); } | |
1619 | + return 0; | |
1615 | 1620 | #endif |
1621 | +} | |
1616 | 1622 | END |
1617 | 1623 | trymake && tryexec |
1618 | 1624 | checked |