Am Dienstag, 19. Februar 2008 schrieb Tom Lane: > Previously, AC_FUNC_FSEEKO did this to test if fseeko was available: > return !fseeko; > Now it does this: > return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0); > > Unfortunately, that gives the compiler enough of a syntactic clue > to guess that fseeko is probably an undeclared function, and therefore > *it will not error out*, only generate a warning, if it's not seen > a declaration for fseeko.
Please try the attached patch. What is currently the consequence of the problem? Does it fail to build, fail to run, or does it fail with large files? -- Peter Eisentraut http://developer.postgresql.org/~petere/
diff -ur ../cvs-pgsql/config/c-library.m4 ./config/c-library.m4 --- ../cvs-pgsql/config/c-library.m4 2005-04-04 09:21:37.000000000 +0200 +++ ./config/c-library.m4 2008-02-19 10:28:11.000000000 +0100 @@ -297,3 +297,29 @@ ])dnl AC_CACHE_VAL AC_MSG_RESULT([$pgac_cv_printf_arg_control]) ])# PGAC_FUNC_PRINTF_ARG_CONTROL + + +# backport from Autoconf 2.61a +# http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=f0c325537a22105536ac8c4e88656e50f9946486 + +# AC_FUNC_FSEEKO +# -------------- +AN_FUNCTION([ftello], [AC_FUNC_FSEEKO]) +AN_FUNCTION([fseeko], [AC_FUNC_FSEEKO]) +AC_DEFUN([AC_FUNC_FSEEKO], +[_AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, 1, + [ac_cv_sys_largefile_source], + [Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2).], + [[#include <sys/types.h> /* for off_t */ + #include <stdio.h>]], + [[int (*fp) (FILE *, off_t, int) = fseeko; + return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);]]) + +# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug +# in glibc 2.1.3, but that breaks too many other things. +# If you want fseeko and ftello with glibc, upgrade to a fixed glibc. +if test $ac_cv_sys_largefile_source != unknown; then + AC_DEFINE(HAVE_FSEEKO, 1, + [Define to 1 if fseeko (and presumably ftello) exists and is declared.]) +fi +])# AC_FUNC_FSEEKO diff -ur ../cvs-pgsql/configure ./configure --- ../cvs-pgsql/configure 2008-02-19 10:26:38.000000000 +0100 +++ ./configure 2008-02-19 10:28:27.000000000 +0100 @@ -18051,11 +18051,13 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <stdio.h> +#include <sys/types.h> /* for off_t */ + #include <stdio.h> int main () { -return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0); +int (*fp) (FILE *, off_t, int) = fseeko; + return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); ; return 0; } @@ -18095,11 +18097,13 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _LARGEFILE_SOURCE 1 -#include <stdio.h> +#include <sys/types.h> /* for off_t */ + #include <stdio.h> int main () { -return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0); +int (*fp) (FILE *, off_t, int) = fseeko; + return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); ; return 0; }
---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster