Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Jan 2002 19:20:55 -0800
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Kutulu <kutulu@kutulu.org>
Cc:        Anders Andersson <anders@hack.org>, Jordan Hubbard <jkh@winston.freebsd.org>, Dallas De Atley <deatley@apple.com>, arch@FreeBSD.ORG
Subject:   Re: __P macro question
Message-ID:  <3C58B817.CD4BA183@mindspring.com>
References:  <tlambert2@mindspring.com> <3C57BED2.E1144F41@mindspring.com> <66467.1012412972@winston.freebsd.org> <20020130175639.GB2437@sushi.sanyusan.se> <3C588DCF.AFC83B3@mindspring.com> <019701c1aa19$27b2fb30$81663244@longhill1.md.home.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Kutulu wrote:
> I generally understand the reason for/against using the prototype-hiding
> macro.  However, your (Terry's) position repeatedly argues for keeping this
> in code to avoid being dependant on GCC.

This is not accurate.  I am arguing that the code should be
portable to tool chains other than the FreeeBSD i386 port
tool chain.  This happens to be GCC.

So, really, there are two issues:

1)	I would like to avoid dependence on needing an ANSI C
	compiler, because I like running interoperable code
	everywhere I can; if I have something one place, I
	want it every place (bash, emacs, and NetBSD users
	should identify with this).

	I think the handwriting is on the wall on this one,
	and non-ANSI compiler support is going to be killed;
	however, I feel compelled to point out the flaws in
	the arguments for this, which are the following false
	assumptions:

	o	GCC runs everywhere, and it's easy to
		port where it doesn't [this adds to the
		cost of any project]
	o	There is no ongoing cost to maintaining a
		port of GCC to a new platform, so if there
		is not ANSI compiler, there's GCC [there is
		a two year source availability clause in the
		GPL that can only be satisfied by a source
		escrow, to meet the terms of the license,
		should the GCC people not integrate your
		port into their distribution]

2)	I would like to avoid the dependency on the GCC compiler,
	itself, for several reasons:

	o	As a matter of general principle
	o	As a "CYA" on the "or any future version
		of this license" clause under which the
		code was obtained.
	o	The code generated by the GCC compiler is
		not as good as that available in other
		compilers, particularly for the P4, Alpha,
		PPC, and SPARC, all of which are more
		important than the i386, for which support
		has been dropped in GENERIC, and is only
		available through recompilation with
		alternate configuration options
	o	Use of GCC'isms will result in naeive
		programmers writing code that can not be
		compiled with even other ANSI-C standard
		compilers (e.g. TenDRA, the Compaq Alpha
		compiler, the SunSoft SPARC compiler, the
		Intel IA32/IA64 compilers, etc.), in much
		the same way that use of "bash" and "GNU
		make" on Linux has resulted in shell scripts
		and Makefiles which are not portable to
		other platforms... and worse, tools that
		automatically generate these scripts and
		Makefiles, not knowing that their output
		amplification effect will result in widescale
		problems.

	I feel compelled to also point out the flaws in the "All
	the world is GCC" arguments for this, which are the
	following false assumptions:

	o	GCC is available everywhere [it's not]
	o	The code will only ever be used in the
		context of FreeBSD itself, not a reference
		for another platform [this is a really
		bogus assumption, and exposes the heart
		of why FreeBSD is distributed under the
		BSD license rather than the GPL: to make
		its source code useful as a reference
		implementation in other than FreeBSD]
	o	Use of GCC is preferrable [as pointed out
		above, the code generation is non-optimal]
	o	There is no cost to using GCC [also,
		noted above]

	Here is Intel's paper on "software optimization techniques
	and tools to achieve leading-edge performance on current
	and future generations of the IA-32 high-performance
	processors"... in other words, this information will
	continue to be valid going forward:

	http://developer.intel.com/design/pentium4/papers/249438.htm

	A short summary:

		Don't do what GCC does


> Is GCC the only UNIX compiler that can compile code with prototypes?
> Isn't that an ANSI standard requirement, not a gcc-ism?  I have never
> used any compiler other than gcc and some Borland stuff, so I really
> don't know the answer, but it seems to me that anyone, like myself,
> coming into UNIX development at this point in time would expect *some*
> ANSI-enabled compiler to be around for any platform, wether the GNU
> people wrote it or not.
> 
> Is this a stupid assumption to make?

For certain problem domains, it is an incorrect assumption;
the problems are deeper than they are being portrayed by some.

-- Terry

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3C58B817.CD4BA183>