From owner-freebsd-current Tue Jan 20 18:24:24 1998 Return-Path: Received: (from daemon@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA01171 for current-outgoing; Tue, 20 Jan 1998 18:24:24 -0800 (PST) (envelope-from owner-freebsd-current) Received: from alpha.xerox.com (firewall-user@alpha.Xerox.COM [13.1.64.93]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id SAA01103 for ; Tue, 20 Jan 1998 18:23:52 -0800 (PST) (envelope-from fenner@parc.xerox.com) Received: from crevenia.parc.xerox.com ([13.2.116.11]) by alpha.xerox.com with SMTP id <52684(4)>; Tue, 20 Jan 1998 18:23:49 PST Received: by crevenia.parc.xerox.com id <177476>; Tue, 20 Jan 1998 18:23:45 -0800 From: Bill Fenner To: fenner@parc.xerox.com, joelh@gnu.org Subject: Re: Nasty GCC bug? Cc: current@freebsd.org, sef@kithrup.com Message-Id: <98Jan20.182345pst.177476@crevenia.parc.xerox.com> Date: Tue, 20 Jan 1998 18:23:34 PST Sender: owner-freebsd-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk It's easy to read it to say that promotions are required. However, all it really says is that ANSI only guarantees that things work if you match types with the promoted type. However, if you have some way to intuit what type was passed in (e.g. Terry's description of an argument passing scheme which passes types along with values and delays promotion until required), you might see a loop like: switch (va_type(ap)) { /* non-ANSI function */ case VA_CHAR: c = va_arg(ap, char); /* ANSI says this is undefined */ break; ... } Now, that usage of va_arg(), according to ANSI, is undefined. That just means that ANSI doesn't tell us what it's supposed to do, not that ANSI requires that it doesn't do something useful. I was just trying to refute sef's assertion that a compiler/library that implemented printf() in this way was buggy or wrong. It's not. It's defining a certain behavior that ANSI chose not to define. Terry is asserting that FreeBSD should have this behavior, which is a fine thing to have an argument about, but it shouldn't be based upon an assertion that it's an incorrect thing to do. Bill