gccxml regression: fails to parse stdio.h

Bug #293807 reported by vishnoo on 2008-11-04
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gccxml (Ubuntu)
High
Unassigned

Bug Description

Binary package hint: gccxml

gccxml fails to parse standard header stdio.h in Intrepid, whereas it works perfectly using the hardy package

steps to reproduce:
$> echo '#include <stdio.h>' > foo.h
$> gccxml foo.h
In file included from /usr/include/stdio.h:906,
                 from foo.h:1:
/usr/include/bits/stdio2.h: In function 'int sprintf(char*, const char*, ...)':
/usr/include/bits/stdio2.h:35: error: '__builtin_va_arg_pack' was not declared in this scope
/usr/include/bits/stdio2.h: In function 'int snprintf(char*, size_t, const char*, ...)':
/usr/include/bits/stdio2.h:66: error: '__builtin_va_arg_pack' was not declared in this scope
/usr/include/bits/stdio2.h: In function 'int fprintf(FILE*, const char*, ...)':
/usr/include/bits/stdio2.h:99: error: '__builtin_va_arg_pack' was not declared in this scope
/usr/include/bits/stdio2.h: In function 'int printf(const char*, ...)':
/usr/include/bits/stdio2.h:105: error: '__builtin_va_arg_pack' was not declared in this scope
/usr/include/bits/stdio2.h: In function 'int asprintf(char**, const char*, ...)':
/usr/include/bits/stdio2.h:159: error: '__builtin_va_arg_pack' was not declared in this scope
/usr/include/bits/stdio2.h: In function 'int __asprintf(char**, const char*, ...)':
/usr/include/bits/stdio2.h:167: error: '__builtin_va_arg_pack' was not declared in this scope
/usr/include/bits/stdio2.h: In function 'int dprintf(int, const char*, ...)':
/usr/include/bits/stdio2.h:174: error: '__builtin_va_arg_pack' was not declared in this scope
/usr/include/bits/stdio2.h: In function 'int obstack_printf(obstack*, const char*, ...)':
/usr/include/bits/stdio2.h:182: error: '__builtin_va_arg_pack' was not declared in this scope

Related branches

Václav Šmilauer (eudoxos) wrote :

Confirming, __builtin_va_arg_pack is undefined. The file /usr/share/gccxml-0.9/GCC/4.3/gccxml_builtins.h says:

 In order to really support these we would have to update GCC-XML's
 internal parser to be GCC 4.3. Since this has not yet been done we
 get most of the way by defining some of these as macros with fake
 answers. It is enough to get through GCC 4.3's C++98 standard
 library.

As workaround, you can add this at the end of the file:

 int __dummy__(...);
 #define __builtin_va_arg_pack __dummy__

The example you give "compiles" fine, and some quite complex code does as well.

Changed in gccxml:
status: New → Confirmed
Guy K. Kloss (guy.kloss) wrote :

I second the motion of getting GCCXML working out of the box with at least the usual libraries as stdio. Adding a dummy is fine as long as it is your "own" code, but it can create bigger problems on third party code. Could a dummy like that one be added to the other macros mentioned?

Where would they be found to patch the GCCXML install rather than having to add this macro to every source file affected?

Guy K. Kloss (guy.kloss) wrote :

Maybe this helps. I have created some instructions on how to patch GCCXML to handle the stdio.h bug, and recompiled a Debian package. More information can be found here, although it is only a workaround:

http://www.kloss-familie.de/moin/Root/PatchingGccXml

Guy K. Kloss (guy.kloss) wrote :

another workaround:
 * Install GCC 4.2
 * export GCCXML_COMPILER=gcc-4.2
 * now GCCXML should use gcc-4.2 instead, and things should work again

Luca Falavigna (dktrkranz) wrote :

Attached patch, taken from upstream CVS, fixes this regression.

Changed in gccxml:
importance: Undecided → High
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gccxml - 0.9.0+cvs20080525-1ubuntu1

---------------
gccxml (0.9.0+cvs20080525-1ubuntu1) jaunty; urgency=low

  * debian/patches/04_builtin_functions.diff:
    - Patch taken from upstream CVS to fix FTBFS when trying to reference
      hard-coded builtin functions not exported by GCC (LP: #293807).

 -- Luca Falavigna <email address hidden> Tue, 30 Dec 2008 11:52:17 +0100

Changed in gccxml:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers