From owner-freebsd-current Mon Jun 17 0:39:38 2002 Delivered-To: freebsd-current@freebsd.org Received: from mailg.telia.com (mailg.telia.com [194.22.194.26]) by hub.freebsd.org (Postfix) with ESMTP id 7A7FB37B404 for ; Mon, 17 Jun 2002 00:39:31 -0700 (PDT) Received: from d1o913.telia.com (d1o913.telia.com [195.252.44.241]) by mailg.telia.com (8.11.6/8.11.6) with ESMTP id g5H7dUa12761 for ; Mon, 17 Jun 2002 09:39:30 +0200 (CEST) Received: from falcon.midgard.homeip.net (h53n2fls20o913.telia.com [212.181.163.53]) by d1o913.telia.com (8.8.8/8.8.8) with SMTP id JAA20673 for ; Mon, 17 Jun 2002 09:39:29 +0200 (CEST) Received: (qmail 12302 invoked by uid 1001); 17 Jun 2002 07:39:25 -0000 Date: Mon, 17 Jun 2002 09:39:25 +0200 From: Erik Trulsson To: Terry Lambert Cc: Bruce Evans , Maxime Henrion , current@FreeBSD.ORG Subject: Re: duplicate -ffreestanding in kernel build Message-ID: <20020617073924.GA12276@falcon.midgard.homeip.net> Mail-Followup-To: Terry Lambert , Bruce Evans , Maxime Henrion , current@FreeBSD.ORG References: <20020617150426.W3371-100000@gamplex.bde.org> <3D0D8788.D668B2C0@mindspring.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3D0D8788.D668B2C0@mindspring.com> User-Agent: Mutt/1.3.99i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, Jun 16, 2002 at 11:54:00PM -0700, Terry Lambert wrote: > Bruce Evans wrote: > > > Where is this crap, and how to turn it off, spelled out, other > > > than the source code? I didn't see it in the .info; maybe I'm > > > just looking in the wrong place? > > > > Restrictions on C compilers are specified in C standards. The standards > > mostly try to not restrict the compiler. > > So it "just assumes printf and puts use the same underlying > implementation in the C library", and doesn't document its > assumptions anywhere? Not quite. It assumes that the semantics of printf("foo\n") and puts("foo") are identical and therefore can be exchanged for each other. As far as the C standard is concerned this is perfectly fine. If this is really an optimization or not is another question. If you don't want gcc to assume that the functions in the standard library exists and does what the standard says they do, then use the -ffreestanding flag. That is what it is there for. As for documentation I suggest you read the documentation for the -ffreestanding and -fnobuiltin options in gcc. (And read up on the "as-if" rule in the Standard.) > > I think I'm going to be sick. Why? Because your assumptions turned out to be merely assumptions and not facts? > > -- Terry -- Erik Trulsson ertr1013@student.uu.se To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message