Article View: gnu.gcc.bug
Article #1246Trouble using GCC 1.40 and stdarg.h
From: Bernard Fouche
Date: Tue, 29 Sep 1992 11:21
Date: Tue, 29 Sep 1992 11:21
85 lines
2438 bytes
2438 bytes
Hi.
I have a file named try.c :
#include <stdarg.h>
void func(char *fmt,...)
{
va_list pa;
va_start(pa,fmt);
va_end(pa);
}
if I do :
/tmp(!)$ gcc -ansi try.c -c
I have :
try.c: In function func:
try.c:6: parse error before `...'
Everything is okay if I use "cc -Xc" instead of gcc. I'm running Dell
Unix (System V, Release 4.0). Uname -a gives :
cpio1 cpio1 4.0 3.0 EISA i386
Here is /usr/include/stdarg.h provided with my system :
/* Copyright (c) 1990 UNIX System Laboratories, Inc. */
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF */
/* UNIX System Laboratories, Inc. */
/* The copyright notice above does not evidence any */
/* actual or intended publication of such source code. */
#ifndef _STDARG_H
#define _STDARG_H
#ident "@(#)head:stdarg.h 1.8"
#if defined(__STDC__)
#ifndef _VA_LIST
#define _VA_LIST
typedef void *va_list;
#endif
#if __STDC__ != 0 /* -Xc compilation */
#define va_start(list, name) (void) (list = \
(void *)((char *)&name + ((sizeof(name)+(sizeof(int)-1)) & ~(sizeof(int)-1))))
#else
#define va_start(list, name) (void) (list = (void *)((char *)&...))
#endif /* != 0 */
#if u370
#define va_arg(list, mode) ((mode *)(list = \
(char *) ((int)list + 2*sizeof(mode) - 1 & -sizeof(mode))))[-1]
#else
#define va_arg(list, mode) ((mode *)(list = (char *)list + sizeof(mode)))[-1]
#endif /* u370 */
extern void va_end(va_list);
#define va_end(list) (void)0
#else /* not __STDC__ */
#include <varargs.h>
#endif /* __STDC__ */
#endif /* _STDARG_H */
Any idea ? Hope it helps you !
Thank you!
--------------------------------------------------------------------------
Bernard Fouche VOX : +(33) (1) 48.04.56.30 FAX : (33) (1) 48.04.98.95
Email : bernard@cpio1.fr.mugnet.org
Postal Mail : CPIO S.A., 13-15 Rue de la Verrerie, 75004 Paris, France
Technical Details
Message-ID:
<9209291121.AA14946@cpio1.fr.mugnet.org>Path:
arc1-ca.pugleaf.net!sparky!uunet!convex!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!cpio1.FR.mugnet.ORG!bernardShow Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug Path: arc1-ca.pugleaf.net!sparky!uunet!convex!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!cpio1.FR.mugnet.ORG!bernard From: bernard@cpio1.FR.mugnet.ORG (Bernard Fouche) Subject: Trouble using GCC 1.40 and stdarg.h Message-ID: <9209291121.AA14946@cpio1.fr.mugnet.org> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet Distribution: gnu Date: Tue, 29 Sep 1992 11:21:36 GMT Approved: bug-gcc@prep.ai.mit.edu Lines: 87