public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Christoph Lameter <cl@linux.com>,
	David Miller <davem@davemloft.net>,
	linux-kernel@vger.kernel.org
Subject: Re: [rfc] built-in native compiler for Linux?
Date: Mon, 27 Apr 2009 11:41:10 -0700	[thread overview]
Message-ID: <m13abukkhl.fsf@fess.ebiederm.org> (raw)
In-Reply-To: <20090427173420.GD8633@ZenIV.linux.org.uk> (Al Viro's message of "Mon\, 27 Apr 2009 18\:34\:20 +0100")

Al Viro <viro@ZenIV.linux.org.uk> writes:

> On Mon, Apr 27, 2009 at 09:52:46AM -0400, Christoph Lameter wrote:
>> On Sat, 25 Apr 2009, Eric W. Biederman wrote:
>> 
>> > If this was about teaching sparse to run lockdep at compile time, or
>> > generally about making the kernel compilation much faster and able to
>> > catch many more bugs there might be a point where the effort is worth
>> > the investment.
>> 
>> The preprocessor and its interaction with regular C code is quite
>> nasty. If sparse could get rid of the complexities and idiosyncrasies at
>> that level then it may be useful as a "pre" compiler.
>
> Explain, please.  BTW, at the risk of being called an elitist bastard, could
> I ask the participants of that thread to read C99 standard?  It's not hard
> to find (http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1256.pdf, for one
> thing - that's C99 + errata) and at least chapter 5 and 6.10 are really
> must-read if we are talking about that stuff.
>
> In particular, C preprocessor does *NOT* work on text-to-text level and
> hasn't since way back.  It works on token stream.
>
> That's actually one of the areas where C99 is a huge improvement over
> earlier language - instead of more or less nasty kludges still trying
> to pretend that preprocessor was a filter with text output piped into
> compiler, it gives reasonably clear semantics approximating what the
> earlier variants had in common.

Well it came in C89, not C99.  Which could well be the reason the
specification is clear and reasonable.

> I'd done fairly complete rewrite of macro expansion (and a bunch of other
> places in preprocessor) in sparse, and places where it used to deviate from
> standard were by far the worst in terms of convoluted logics and corner
> cases.  Switching to what C99 asked had simplified the things a *lot*;
> it's surprisingly well thought through in that area (unlike e.g. the unholy
> mess around 'restrict' qualifier semantics).

Thank you.  I can't even imagine someone writing a C Preprocessor with
K&R semantics at this late date.

Eric

      reply	other threads:[~2009-04-27 18:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-22  8:58 [rfc] built-in native compiler for Linux? Ingo Molnar
2009-04-23 20:22 ` Anton Ertl
     [not found] ` <alpine.DEB.1.10.0904241429450.19686@qirst.com>
2009-04-25  5:29   ` David Miller
2009-04-25  7:06     ` Eric W. Biederman
2009-04-27 13:52       ` Christoph Lameter
2009-04-27 17:34         ` Al Viro
2009-04-27 18:41           ` Eric W. Biederman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m13abukkhl.fsf@fess.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=cl@linux.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox