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

Markus Neteler neteler at itc.it
Wed Jul 11 10:03:44 EDT 2007


Hi,

I have a new laptop with Mandriva 2007.1 (so x.org). X is not
recognised although all header files are apparently there.
I debugged a bit and found the following (conftest.c and confdefs.h
manually extracted from configure):

cat conftest.c
#line 4672 "configure"
#include "confdefs.h"
#include <X11/Intrinsic.h>

int main() {
XtMalloc()
; return 0; }


cat confdefs.h

#define PEEK_XCLOSEIM 1
#define HAVE_LIMITS_H 1
#define HAVE_TERMIO_H 1
#define HAVE_TERMIOS_H 1
#define HAVE_UNISTD_H 1
#define HAVE_VALUES_H 1
#define HAVE_SYS_IOCTL_H 1
#define HAVE_SYS_MTIO_H 1
#define HAVE_SYS_RESOURCE_H 1
#define HAVE_SYS_TIME_H 1
#define HAVE_SYS_TIMEB_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_UTSNAME_H 1
#define HAVE_LIBINTL_H 1
#define HAVE_ICONV_H 1
#define HAVE_LANGINFO_H 1
#define TIME_WITH_SYS_TIME 1
#define RETSIGTYPE void
#define HAVE_FTIME 1
#define HAVE_GETHOSTNAME 1
#define HAVE_GETTIMEOFDAY 1
#define HAVE_LSEEK 1
#define HAVE_NICE 1
#define HAVE_TIME 1
#define HAVE_UNAME 1
#define HAVE_SETEUID 1
#define HAVE_SETPRIORITY 1
#define HAVE_SETREUID 1
#define HAVE_DRAND48 1
#define HAVE_PUTENV 1
#define HAVE_SETENV 1
#define HAVE_NANOSLEEP 1
#define SETPGRP_VOID 1

gcc -o conftest -g -Wall -Werror-implicit-function-declaration -fno-common -mtune=nocona -m64 -minline-all-stringops    -Wl,--export-dynamic  -L/usr/lib64 conftest.c -lXt
configure: In function 'main':
configure:4676: error: too few arguments to function 'XtMalloc'

I think that -Werror-implicit-function-declaration is the problem here,
taking it out helps. But: For years I am using 
  -Wall -Werror-implicit-function-declaration -fno-common
as flags for gcc to catch potential errors.

How to work around? Do we need to modify the XtMalloc() test?

grep XtMalloc /usr/include/X11/Intrinsic.h
extern char *XtMalloc(
extern char *_XtMalloc( /* implementation-private */
#define XtMalloc(size) _XtMalloc(size, __FILE__, __LINE__)
#define XtNew(type) ((type *) XtMalloc((unsigned) sizeof(type)))
    ((str) != NULL ? (strcpy(XtMalloc((unsigned)strlen(str) + 1), str)) : NULL)

thanks
Markus




More information about the grass-dev mailing list