Sender: bill AT delorie DOT com Message-ID: <377C5992.5C5154C2@taniwha.org> Date: Fri, 02 Jul 1999 18:17:54 +1200 From: Bill Currie X-Mailer: Mozilla 4.6 [en] (X11; I; Linux 2.2.9 i486) X-Accept-Language: en MIME-Version: 1.0 To: djgpp-workers AT delorie DOT com Subject: Re: Regparm and asm statements.. what now? References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Eli Zaretskii wrote: > > On Wed, 30 Jun 1999, Bill Currie wrote: > > > > > According to ANSI C, users can legitimately do that, and still assume > > > > they get a working program. > > > > IMHO, broken spec. Nuff said. > > This ``broken spec'' has survived for 10 years with virtually no > changes, C being the most used language all that time. > > IMHO, every ruling of the ANSI C standard has very good reason for > being there. Sorry, you're right about this, of couse. I was thinking no prototypes at all. I've had problems with this when sizeof(char*)!=sizeof(int). > In this case, there are tons of programs out there which > say things like "char *malloc();" instead of including the header, > because some old compilers didn't have prototypes for some functions, > notably those which return an int. Yes, there are a lot of programs that do that (and need to, unfortunatly), but as the Ten Commandments of C Programming (http://www.ee.ryerson.ca:8080/~elf/hack/The10.html) states (paraphrased): if you do this, KMACYOYO. It's not a safe thing to do (eg char * vs char far * in 16bit dos compilers) when the calling convetion can change under your feet. I've been burned by this, so I'm not just spouting dogma. However, I agree, you *should* be able to do this safely (gcc's multilibbing should help, but it's expensive). Bill -- Leave others their otherness.