This is the mail archive of the gcc@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]
Other format: [Raw text]

gcc.c-torture/execute/stdarg-2.c: long vs int


This test assumes that integer constants passed as varargs are
promoted to a type at least as big as "long", which is not valid on 16
bit hosts.  For example:

void
f1 (int i, ...)
{
  va_start (gap, i);
  x = va_arg (gap, long);


int
main (void)
{
  f1 (1, 79);
  if (x != 79)
    abort ();


Shouldn't those constants be 79L, not just 79?  That change fixes one
m32c failure, but given that it's a test case I'm not going to make
any assumptions about it.


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