The header parameter disables the creation of fake prototypes, and CheckFunc always calls the function with no arguments, so the check fails. This presently works by accident because compilers ignore the second #include in '#include #include ' (so no prototype gets declared) and supply an implicit function declaration which allows calls with any number of arguments. Submitted upstream: diff --git a/SConstruct b/SConstruct index 4964f11f9deaa82a..5cb9a5bd15011f20 100755 --- a/SConstruct +++ b/SConstruct @@ -195,14 +195,7 @@ def check_bigfiles(context): off_t_is_big_enough = False have_stat64 = True - if tests.CheckFunc( - context, 'stat64', - header= - '#include ' - '#include ' - '#include ' - - ): + if tests.CheckFunc(context, 'stat64'): have_stat64 = False rc = int(off_t_is_big_enough or have_stat64) @@ -291,12 +284,7 @@ def check_xattr(context): rc = 1 for func in ['getxattr', 'setxattr', 'removexattr', 'listxattr']: - if tests.CheckFunc( - context, func, - header= - '#include ' - '#include ' - ): + if tests.CheckFunc(context, func): rc = 0 break @@ -312,12 +300,7 @@ def check_lxattr(context): rc = 1 for func in ['lgetxattr', 'lsetxattr', 'lremovexattr', 'llistxattr']: - if tests.CheckFunc( - context, func, - header= - '#include ' - '#include ' - ): + if tests.CheckFunc(context, func): rc = 0 break