Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Jan 1998 17:14:03 PST
From:      Bill Fenner <fenner@parc.xerox.com>
To:        Sean Eric Fagan <sef@kithrup.com>
Cc:        current@freebsd.org
Subject:   Re: Nasty GCC bug? 
Message-ID:  <98Jan20.171409pst.177476@crevenia.parc.xerox.com>
In-Reply-To: Your message of "Tue, 20 Jan 98 14:06:21 PST." <199801202206.OAA18817@kithrup.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
Sean Eric Fagan <sef@kithrup.com> wrote:
>Terry said:
>>... on systems which do not use an
>>integer stack based calling convention, the value can be treated as
>>its type by the varradic function, instead of being treated as an int.
>>It is the promotion caused by the calling convention that is the
>>source of the breakage.
>
>It *has* always been the case; not doing it this way is a bug.

Not quite.  If you don't do it this way, the behavior is undefined --
section 7.8.2.1:

	...or if type is not compatible with the type of the actual
	next argument (as promoted according to the default argument
	promotions), the behavior is undefined.

So it's not *wrong* to allow chars to be passed into varargs functions
as chars, but the ANSI C specification doesn't require it.  Terry wants
to define some of this undefined behavior.

  Bill



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?98Jan20.171409pst.177476>