Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Jun 2002 09:39:25 +0200
From:      Erik Trulsson <ertr1013@student.uu.se>
To:        Terry Lambert <tlambert2@mindspring.com>
Cc:        Bruce Evans <bde@zeta.org.au>, Maxime Henrion <mux@FreeBSD.ORG>, current@FreeBSD.ORG
Subject:   Re: duplicate -ffreestanding in kernel build
Message-ID:  <20020617073924.GA12276@falcon.midgard.homeip.net>
In-Reply-To: <3D0D8788.D668B2C0@mindspring.com>
References:  <20020617150426.W3371-100000@gamplex.bde.org> <3D0D8788.D668B2C0@mindspring.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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


-- 
<Insert your favourite quote here.>
Erik Trulsson
ertr1013@student.uu.se

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




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