Subject: Re: K&R vs. ANSI call conventions (was Re: a new KNF)
To: Jason Thorpe <thorpej@nas.nasa.gov>
From: Andrew Cagney <ac131313@cygnus.com>
List: tech-toolchain
Date: 02/21/2000 11:38:04
Jason Thorpe wrote:
> 
> On Fri, 18 Feb 2000 16:37:55 +0900 (JST)
>  itohy@netbsd.org (ITOH Yasufumi) wrote:
> 
>  > In order to avoid this sort of mistakes, I propose the following
>  > patch to gcc and to add -Wabi-breakage to library/kernel makefiles.
>  > We already have -Werror and if we write library/kernel in current KNF,
>  > breaking ABI becomes impossible.
>  >
>  > This change doesn't affect any strictly conforming programs, and I
>  > think it does no harm.
> 
> I think this is a good idea, and the GCC people might even buy it back.
> 
>         -- Jason R. Thorpe <thorpej@nas.nasa.gov>

Just an asside:

A second area that can suffer ``abi-breakage'' is with enum's.  Some
compilers (rightly) point out that:
	void f (enum e i);
	void f (i) enum e i; {};
isn't portable.

As for a flag, there is already ``-ansi --pedantic'' which will detect
most issues (unfortunatly it likes to detect a few more .... :-). 
Someone putting forward a patch will need to keep that in mind.

	enjoy,
		Andrew