[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <44a0cc9cb5344add8ee4d91bffbf958f@AcuMS.aculab.com>
Date: Fri, 5 Mar 2021 09:19:42 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Linus Torvalds' <torvalds@...ux-foundation.org>
CC: Tom Tromey <tom@...mey.com>, Alexey Dobriyan <adobriyan@...il.com>,
"Luc Van Oostenryck" <luc.vanoostenryck@...il.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Sparse Mailing-list <linux-sparse@...r.kernel.org>
Subject: RE: [PATCH 00/11] pragma once: treewide conversion
From: Linus Torvalds
> Sent: 04 March 2021 20:16
>
> On Thu, Mar 4, 2021 at 5:55 AM David Laight <David.Laight@...lab.com> wrote:
> >
> > > (a) the traditional include guard optimization HAS NO HIDDEN SEMANTIC
> > > MEANING. It's a pure optimization that doesn't actually change
> > > anything else. If you don't do the optimization, absolutely nothing
> > > changes.
> >
> > And if the parser is well written the optimisation is probably
> > irrelevant compared to the compile time.
>
> That's actually surprisingly not even remotely true.
The point is that you can skip the unwanted parts of
#if without having to parse the file at all.
You just need to detect the line breaks.
So yes, you need to read the file and look at every byte.
But you don't need to even start tokenising it.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists