Date: Tue, 20 Jan 1998 22:02:07 +0000 (GMT) From: Terry Lambert <tlambert@primenet.com> To: sef@kithrup.com (Sean Eric Fagan) Cc: current@FreeBSD.ORG Subject: Re: Nasty GCC bug? Message-ID: <199801202202.PAA00510@usr06.primenet.com> In-Reply-To: <199801202123.NAA15093@kithrup.com> from "Sean Eric Fagan" at Jan 20, 98 01:23:31 pm
next in thread | previous in thread | raw e-mail | index | archive | help
> I don't normally do this, but: Terry you don't know what you're talking > about. As I've explained in my two messages today. [ ... ] > It's not my fault the program in question was buggy -- it has always been the > case that you had to mask out signed char values for printf statements, since > printf has never had a size modifier to treat a char-sized value as an > integer. Is is an artifact of the calling convention, which is implementation defined. It has *NOT* "always been the case"; 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. VMS is one such system; it makes calls by descriptor rather than by integers on a stack. The descriptor contains the type information, and it does the unsurprising, and outputs via printf that which was input via scanf in such a way as to allow the program to run against the data that was output. It is probably more corrrect to say "the program depended on implementation defined behavior". Nevertheless, I was surprised when my data got garbled. 8-|. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199801202202.PAA00510>
