Discussion:
[ast-developers] gcc -I/usr/include/ast no longer works in ast-open.2014-07-21
Lionel Cons
2014-10-21 18:30:16 UTC
Permalink
Our nextgen-grid group ran into serious trouble with the new ast-open
package - /usr/include/ast can no longer be put in front of
/usr/include for most projects.

example:
$ cat x.c
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>
int
main ()
{
/*
* Use volatile, or else optimization can cause false positives.
*/
void (* volatile p)() = (void (*)())res_search;
;
return 0;
}
$ gcc -std=gnu99 -m64 x.c -lresolv
$ echo $?
0

So this works fine.

BUT:

$ gcc -std=gnu99 -m64 -D_LARGEFILE64_SOURCE -I/usr/include/ast x.c
-lresolv -last
In file included from /usr/include/ast/ast_common.h:240:0,
from /usr/include/ast/bytesex.h:29,
from /usr/include/ast/endian.h:29,
from /usr/include/sys/types.h:216,
from x.c:1:
/usr/include/stdlib.h:209:22: error: conflicting types for ‘_ast_strtoll’
extern long long int strtoll (const char *__restrict __nptr,
^
/usr/include/ast/ast_map.h:485:34: note: previous declaration of
‘_ast_strtoll’ was here
extern __MANGLE__ _ast_intmax_t strtoll __PROTO__((const char*, char**, int));
^
/usr/include/stdlib.h:214:31: error: conflicting types for ‘_ast_strtoull’
extern unsigned long long int strtoull (const char *__restrict __nptr,
^
/usr/include/ast/ast_map.h:486:42: note: previous declaration of
‘_ast_strtoull’ was here
extern __MANGLE__ unsigned _ast_intmax_t strtoull __PROTO__((const
char*, char**, int));
^
/usr/include/ast/ast_sys.h:228:25: error: conflicting types for
‘_ast_resolvepath’
extern __MANGLE__ char* resolvepath __PROTO__((const char*, char*, size_t));
^
/usr/include/ast/ast_map.h:322:24: note: previous declaration of
‘_ast_resolvepath’ was here
extern __MANGLE__ int resolvepath __PROTO__((const char*, char*, size_t));

$ grep -r _ast_intmax_t /usr/include/ast | fgrep define
/usr/include/ast/ast_common.h:#define _ast_intmax_t _ast_int8_t
$ grep -r _ast_int8_t /usr/include/ast | fgrep define
/usr/include/ast/ast_common.h:#define _ast_int8_t long
/usr/include/ast/ast_common.h:#define _ast_intmax_t _ast_int8_t

So the basic problem is prototype mismatch - resolvepath() is obvious
and the other is long long vs long.

Glenn, Roland, we need an urgent patch. Whatever you have, please. The
whole project group is stalled after the upgrade ;-(

Lionel

Loading...