www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/01/02/21:09:05

Date: Sun, 2 Jan 94 20:42:42 EST
From: peprbv AT cfa0 DOT harvard DOT edu (Bob Babcock)
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: stdarg.h needs to be updated

A while back, I complained that a function with prototype something like
  void foo(short i,...);
worked with gcc 2.4.1 (djgpp 1.10), but failed with gcc 2.5.4 or 2.5.7 (djgpp
1.11).  The failure was that the EBX register, which was supposed to point to
the variable part of the argument list, instead pointed at a temporary on the
stack.  I posted a bug report to the gnu people.  The first response was that
my code was wrong: the last argument before ...  cannot be a "narrow" type
such as short.  An excerpt from the ANSI standard posted on BIX supported
this claim.  (But in that case, shouldn't the compiler give an error
message?)  Then Stephen Moshier reported that my example routine also failed
under linux.  He sent me a revised stdarg.h from the current gcc, and using
that, my example program started working.  Apparently, there are several
include files which should be updated with each new compiler release, but
this has not been done with djgpp.  Quoting from Moshier's mail to me:

> These files, identified in the gcc Makefile, come with the gcc
> source distribution and would ordinarily be updated along with the
> compiler on any system.  I don't think Delorie has been doing this.
> 
> cp $(srcdir)/gvarargs.h include/varargs.h
> cp $(srcdir)/gstdarg.h include/stdarg.h
> cp $(srcdir)/gstddef.h include/stddef.h
> cp xlimits.h include/limits.h
> cp $(srcdir)/README-fixinc include/README
> 
> and the output of `enquire':
> cp gfloat.h include/float.h

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019