• R/O
  • SSH
  • HTTPS

yash: 提交


Commit MetaInfo

修訂4201 (tree)
時間2022-08-20 15:17:01
作者magicant

Log Message

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.

Change Summary

差異

--- yash/trunk/configure (revision 4200)
+++ yash/trunk/configure (revision 4201)
@@ -1608,11 +1608,17 @@
16081608 #include <stdint.h> /* required before <sys/resource.h> on freebsd */
16091609 #include <sys/time.h> /* required before <sys/resource.h> on old Mac OS X */
16101610 #include <sys/resource.h>
1611+int main(void) {
1612+ if (0) {
1613+ struct rlimit r;
1614+ getrlimit(RLIMIT_${i}, &r);
1615+ }
16111616 #if HAVE_RLIMIT_AS
1612-int main(void) { return RLIMIT_${i} == RLIMIT_AS; getrlimit(RLIMIT_${i}, 0); }
1617+ return RLIMIT_${i} == RLIMIT_AS;
16131618 #else
1614-int main(void) { return 0; getrlimit(RLIMIT_${i}, 0); }
1619+ return 0;
16151620 #endif
1621+}
16161622 END
16171623 trymake && tryexec
16181624 checked
Show on old repository browser