[GRASS-dev] configuration X fails with strict gcc flags

Glynn Clements glynn at gclements.plus.com
Thu Jul 12 07:46:22 EDT 2007


Markus Neteler wrote:

> > Have you re-built your configure script using a different version of
> > autoconf?
> 
> Probably I added it in the debug output since I assumed that it was
> there. So, after reset to CVS version, it turns out to be this problem:
> 
> configure:4675: error: implicit declaration of function 'XtMalloc'
> 
> probably still caused by the -Werror-implicit-function-declaration 
> flag.

Yes. You may need to add that flag manually to Platform.make after
configure has run.

The autoconf linking checks (AC_CHECK_FUNCS, AC_CHECK_LIB etc) never
include the header files, as that would give "too few arguments"
errors, like the one you encountered (configure only knows the name of
the function, not its type, so it has to call it without arguments).

> Maybe the gcc behaviour changed? It is
>  Target: x86_64-mandriva-linux-gnu
>  gcc version 4.1.2 20070302 (prerelease) (4.1.2-1mdv2007.1)
> 
> On my office box (RHEL4, 64bit), it works with identical flags, but it is:
>  Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/specs
>  gcc version 3.4.6 20060404 (Red Hat 3.4.6-8)
> 
> I wonder why only this test fails.

The test program created by AC_CHECK_FUNC[S] normally includes a dummy
prototype for the function, e.g.:

	#line 4893 "configure"
	#include "confdefs.h"
	/* Override any gcc2 internal prototype to avoid an error.  */
	/* We use char because int might match the return type of a gcc2
	    builtin and then its argument prototype would still apply.  */
===>	char dnet_ntoa();
	
	int main() {
	dnet_ntoa()
	; return 0; }

However, the X checks call AC_TRY_LINK directly, without providing a
prototype. I don't know why, and I don't know why this didn't trigger
an error before.

The XtMalloc check is part of AC_PATH_X, and calling that isn't really
optional if we want to use X.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list