🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #53478

Strange behavior on varargs.h

#53478
From: Lextrait Vincent
Date: Mon, 23 Dec 1991 12:08
29 lines
1040 bytes
With gcc-1.40, on a SS1(SunOs 4.1), the following program outputs 0 :

#include <varargs.h>
unsigned short int i=80;
int f(
      va_alist
)
{
  va_list ap;
  unsigned short int j;
  va_start(ap);
  j=va_arg(ap, unsigned short int);
  va_end(ap);
  return((int)j);
}

main(
)
{
  printf("%d\n",f(i));
}

With /bin/cc, it outputs 80.

Is it a bug of gcc ?

Vincent Lextrait
University of Nice
lextrait@essi.cerisi.fr
Technical Details
Message-ID: <9112231008.AA14383@essi.cerisi.fr>
Path: arc1-ca.pugleaf.net!gmdzi!ieee.org!sdd.hp.com!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!essi.cerisi.fr!lextrait

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,999440f5d097b578,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1991-12-23 12:59:51 PST
Path: arc1-ca.pugleaf.net!gmdzi!ieee.org!sdd.hp.com!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!essi.cerisi.fr!lextrait
From: lextrait@essi.cerisi.fr (Lextrait Vincent)
Newsgroups: gnu.gcc.help
Subject: Strange behavior on varargs.h
Message-ID: <9112231008.AA14383@essi.cerisi.fr>
Date: 23 Dec 91 12:08:52 GMT
Sender: daemon@cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 29