Subject: Re: port-xen/29887: sysctl kern.consdev coredumps
To: None <port-xen-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: James Chacon <jmc@NetBSD.org>
List: netbsd-bugs
Date: 06/21/2005 18:15:04
The following reply was made to PR port-xen/29887; it has been noted by GNATS.

From: James Chacon <jmc@NetBSD.org>
To: Jason Thorpe <thorpej@shagadelic.org>,
	Bill Studenmund <wrstuden@NetBSD.org>,
	YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>, jhawk@MIT.EDU,
	christos@zoulas.com, gnats-bugs@NetBSD.org,
	port-xen-maintainer@NetBSD.org, netbsd-bugs@NetBSD.org,
	tech-userlevel@NetBSD.org
Cc: 
Subject: Re: port-xen/29887: sysctl kern.consdev coredumps
Date: Tue, 21 Jun 2005 13:14:25 -0500

 On Tue, Jun 21, 2005 at 01:08:12PM -0500, James Chacon wrote:
 > On Tue, Jun 21, 2005 at 10:00:13AM -0700, Jason Thorpe wrote:
 > > 
 > > On Jun 20, 2005, at 9:11 PM, Bill Studenmund wrote:
 > > 
 > > >The problem though is that thanks to gcc, how puts() behaves is how
 > > >printf() behaves some of the time. So printf() no longer has its
 > > >historical behavior.
 > > 
 > > So what?  It wasn't documented behavior, so anyone who depends on it  
 > > is being foolish anyway.
 > > 
 > 
 > That should only be true when gcc provides the complete implementation. It's
 > clear this isn't true here. Libc is provided from something else, yet gcc
 > is deciding "it's knows best" and substituting it's own rules in between.
 > 
 > Basically according to the logic above any stdc89/99 defined function cannot
 > have any extentions without the user using -ffreestanding. BEcause otherwise
 > gcc (from what you say) could just completely inline libc from it's own 
 > implementation and by god...assuming it actually used the one installed on
 > my system is my own fault for assuming something so likely....
 
 BTW: -ffreestanding doesn't even imply it's what I would be using for
 this:
 
        -ffreestanding
            Assert that compilation takes place in a freestanding environment.
            This implies -fno-builtin.  A freestanding environment is one in
            which the standard library may not exist, and program startup may
            not necessarily be at "main".  The most obvious example is an OS
            kernel.  This is equivalent to -fno-hosted.
 
 Obviously in the case being discussed this is a normal program depending on
 the libc version of printf *on that system* to be called. There would be
 no reason for any programmer to assume that in order to do that they have
 to add -ffreestanding to their compile line based on that man page description.
 
 James