Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Jun 2002 22:31:55 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        Maxime Henrion <mux@FreeBSD.ORG>, current@FreeBSD.ORG
Subject:   Re: duplicate -ffreestanding in kernel build
Message-ID:  <3D0C22CB.A3DD0EA8@mindspring.com>
References:  <20020616134100.M1933-100000@gamplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Bruce Evans wrote:
printf( <const string>); -> pusts( <const string>);

> > That is an incredibly *fugly* "optimization".  It assumes that I
> > use libc, unless I have "-ffreestanding", and it assumes my
> > implementation of printf vs. puts.
> 
> This is a routine optimization.  It assumes that you use a C compiler
> (printf and even libc might not exist, since they might be builtins).
> A non-routine optimization might involve building hardware to run the
> application and emitting the 1 bit instruction to turn the hardware on.

It's routine to assume that I'm going to use libc?!?

I understand the -fnobuiltins thing... particularly if the compiler
generates code that makes a function call, instead of generating
the code inline, and saving the call/return (kind of makes you want
-fnobuiltins by default, though, since "I'm smarter than the compiler
writers" is a common base assumption).

I *really* don't understand them making assumptions about the
instrumentation that I may or may not have put between myself and
the libc implementations of functions, though.

Historically, for code portability, I used to carry around my own
printf(), and I didn't even have a puts(); this "optimization" would
*really* break things.

-- Terry

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?3D0C22CB.A3DD0EA8>