[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <84F157C1-AD98-473D-9CF6-2A26A499DECF@zytor.com>
Date: Sat, 19 May 2018 01:18:59 -0700
From: hpa@...or.com
To: Alexey Dobriyan <adobriyan@...il.com>,
Ingo Molnar <mingo@...nel.org>
CC: Josh Poimboeuf <jpoimboe@...hat.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Peter Anvin <h.peter.anvin@...el.com>,
kernel test robot <xiaolong.ye@...el.com>,
Thomas Gleixner <tglx@...utronix.de>,
Andrew Lutomirski <luto@...nel.org>,
Borislav Petkov <bp@...en8.de>,
Brian Gerst <brgerst@...il.com>,
Denys Vlasenko <dvlasenk@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
tipbuild@...or.com, LKP <lkp@...org>
Subject: Re: [PATCH] objtool: Detect assembly code falling through to INT3 padding
On May 18, 2018 10:51:36 AM PDT, Alexey Dobriyan <adobriyan@...il.com> wrote:
>On Fri, May 18, 2018 at 09:18:14AM +0200, Ingo Molnar wrote:
>> The concept of built-in kernel tooling working at the machine code
>level is just
>> so powerful - we should have added our own KCC compiler 20 years ago.
>
>...for two very serious reasons
>
>* C as a language moves very slowly, last help from the comittee were
> C99 intializers which are OK, but, say, memory model was explictly
> rejected. However the project expands and becomes more complex much
> faster than C working group sets up meetings. Compiler authors help
>with extensions but ultimately can not be relied on (see "inline"
>saga).
>
> Recently everyone was celebrating new and improved min() and max()
> macros admiring creativity and knowledge of intricate language details
> (me too, don't get this wrong).
>
> Now this is how it can be done in a language which is not stupid:
>
> constexpr int min(int a, int b)
> {
> return a < b ? a : b;
> }
>
> That's literally all. And you can also do
>
> template<typename T>
> void min(T a, char b) = delete;
>
> template<typename T>
> void min(char a, T b) = delete;
>
> because "char" is char.
>
> Having control over compiler things like that can be addded more
> quickly.
>
>
>* insulating the project from the whims of compiler authors who every
> once in a while use "undefined behaviour" or other kinds of language
> lawyering to do strange things.
>
> Other serious projects do this too. Database people use O_DIRECT
> to insulate themselves from kernel people for the very same reasons.
Sounds like you are proposing switching to C++ more than anything else.
*Steps aside and grabs popcorn*
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
Powered by blists - more mailing lists