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]

COmpiler bug: va_list redeclared on Tru64 (Alpha)



I am getting a compiler warning compiling the LPRng program. I have isolated
the problem to an include file, va-alpha.h, included by other includes. I have
a two line test case that causes the warning message. This appears to be a
problem in the way that the va_list.h and va-alpha.h include files are embedded
in other include files (e.g., stdarg.h) and the use of #defines to avoid
redeclarations. This problem did not exist in gcc v2.8.1.

Here are the specifics:

Version: gcc version 2.95.2 19991024 (release)
O/S: Tru64 V4.0E patch 3 on a Compaq Alpha 2100a
GCC configure options: none
Modifications made to GCC source: none
GCC command: gcc -c -o testcase.o testcase.c

testcase.c:

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
#include <ctype.h>
#include <stdarg.h>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Output from compiler:

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
gcc -c -o testcase.o testcase.c
In file included from 
/usr/local/lib/gcc-lib/alphaev5-dec-osf4.0e/2.95.2/include/stdarg.h:36,
	from testcase.c:2:
/usr/local/lib/gcc-lib/alphaev5-dec-osf4.0e/2.95.2/include/va-alpha.h:37: warning: redefinition 
of `va_list'
/usr/local/lib/gcc-lib/alphaev5-dec-osf4.0e/2.95.2/include/va_list.h:7: warning: `va_list' 
previously declared here
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Suggested patch which may be too limited in scope but does stop the error
message:

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
*** va-alpha.h.orig     Wed Sep 20 16:57:39 2000
--- va-alpha.h  Wed Sep 20 16:57:02 2000
***************
*** 30,39 ****
--- 30,41 ----
  #if !defined(__GNUC_VA_LIST_1) && (defined (_STDARG_H) || defined 
(_VARARGS_H))
  #define __GNUC_VA_LIST_1
  
+ #if !defined(_VA_LIST)
  #define _VA_LIST
  #define _VA_LIST_
  
  typedef __gnuc_va_list va_list;
+ #endif
  
  #if !defined(_STDARG_H)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

gcc/ChangeLog entry:

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Wed Sep 20 17:09:12 EDT 2000 Justus Addiss (jjaddiss@mmm.com)
	* ginclude/va-alpha.h: Protect typedef of va_list against 
	double inclusion.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- Justus Addiss

-- 
Think to the future and beyond....

 /** Justus J. Addiss               Email: jjaddiss@mmm.com     **\
<*** 3M Health Information Systems  Phone: 203-949-0303 x6414   ***>
 \** Wallingford, CT 06492-1802     FAX:   203-949-6455 or 6331 **/


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