bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GNU tar 1.13.25 configure bugs vs. gcc and AST library and headers


From: Bruce Lilly
Subject: GNU tar 1.13.25 configure bugs vs. gcc and AST library and headers
Date: Sat, 13 Jul 2002 12:32:39 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020204

The AST (http://www.reasearch.att.com/sw/download) headers
correctly declare a large number of functions. The configure
script in GNBU tar 1.13.25 generates "test" files which
*incorrectly* declare the functions, pirportedly to avoid
some gcc v. 2 issues.  Ironically, gcc 2.95.3 complains
about the bogus redeclaration in configure's test files.

Configure fails for a large number of functions, e.g.
strtol, strncasecmp, rmdir, rename, strstr, ....

A typical config.log entry for the failure is:

configure:6385: checking for pathconf
configure:6422: gcc -o conftest -g -O2 -I/usr/include/ast -include 
/usr/include/ast/ast.h -last conftest.c  >&5
configure:6401: conflicting types for `_ast_pathconf'
/usr/include/ast/ast_std.h:763: previous declaration of `_ast_pathconf'
configure:6425: $? = 1
configure: failed program was:
#line 6391 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char pathconf (); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char pathconf ();
char (*f) ();

int
main ()
{
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_pathconf) || defined (__stub___pathconf)
choke me
#else
f = pathconf;
#endif

  ;
  return 0;
}
configure:6441: result: no


The correct declaration for pathconf is:

extern long pathconf (const char*, int);

and gcc complains when the incorrect declaration in the test
file, viz.

char pathconf ();

appears.


In most cases, changing the "char" to "extern" avoids
the error, but that doesn't work for functions which
return a pointer.

Clearly this is a configure (autoconf) bug.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]