This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

possible va-alpha.h bug in DEC alpha gcc-2.95.1


I believe there is a possible bug in the DEC alpha implementation
of gcc-2.95.1.  The following code demonstrates this possible bug.

***********************

#include <stdio.h>
#include <stdarg.h>

main()
{
}

***********************

Compiling this code (on a DEC alpha) gives the following warnings:

***********************

%gcc -o foo foo.c
.../gcc-2.95.1/OSF1/lib/gcc-lib/alphaev6-dec-osf4.0e/2.95.1/include/stdarg.h:36,
                 from foo.c:2:
.../gcc-2.95.1/OSF1/lib/gcc-lib/alphaev6-dec-osf4.0e/2.95.1/include/va-alpha.h:\
36: warning: redefinition of `va_list'
.../gcc-2.95.1/OSF1/lib/gcc-lib/alphaev6-dec-osf4.0e/2.95.1/include/va_list.h:7\
: warning: `va_list' previously declared here
%

***********************

Most likely these warnings are not serious.  However warnings make me
nervous, so I tracked these down.

They seem to be caused because "stdio.h" invokes "va_list.h" which
defines `va_list'.  Then "stdarg.h" invokes "va-alpha.h" which again
defines `va_list'.

Complicating the picture is that "stdio.h" calls "stdarg.h" (at line 2
for a reason that escapes me).  This call to "stdarg.h" invokes
"va-alpha.h" which defines the flag `__GNUC_VA_LIST', but does NOT
define `va_list'.

Now in "va-alpha.h" the `#ifndef' for `__GNUC_VA_LIST' is closed
(#endif) at line 25 BEFORE the definition of `va_list'.

A fix that SEEMS to work is to move line 25 of "va-alpha.h" below
line 36; i.e., AFTER the definition of `va_list'.  However I have no
idea if this breaks other code; I freely admit to not being an expert
in this area.

I would appreciate it if someone more knowledgeable than I would
look this over, verify the result, and let me know if there is a
better fix.

Blair Kelly 



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]