Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Bo Persson Newsgroups: comp.lang.c++ Subject: Re: "Richard Stallman Announces C Reference" Date: Mon, 12 Sep 2022 20:32:21 +0200 Lines: 50 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net ZYUmaRgiotcVRGqFeB7ddg+M9v2Ydk87h5MnFOvw2edOcc9SjA Cancel-Lock: sha1:tznqGy3U0DtFmni9PJzDSugFwM4= User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Content-Language: sv In-Reply-To: Xref: csiph.com comp.lang.c++:86291 On 2022-09-12 at 17:58, Muttley@dastardlyhq.com wrote: > On Mon, 12 Sep 2022 09:18:44 +0200 > Bo Persson wrote: >> On 2022-09-11 at 17:44, Muttley@dastardlyhq.com wrote: >>> On Sun, 11 Sep 2022 13:42:20 +0200 >>> Bonita Montero wrote: >>>> Am 11.09.2022 um 11:44 schrieb Muttley@dastardlyhq.com: >>>> >>>>> The necessity is for a language that can have embedded assembler, is very >>>>> efficient to compile and once compiled and is explicit. Because of this >>>>> C++'s hidden conversions, exceptions and most of the STL can be ruled >>>>> out which doesn't leave much left thats an advantage over C. >>>> >>>> That all isn't a problem in the kernel if you know what you do. >>>> Kernel-Programmers are very skilled and the should be able to >>>> handle that, but it's not up to their mindset. >>> >>> Its nothing to do with their mindset, its to do with knowing EXACTLY what the >> >>> code is going to do and/or where the program counter is going to go. >> >> I have never understood how you can know EXACTLY what the code does in >> >> int y = f(x); >> >> but have no clue about what happens in >> >> my_class f(x); > > And if that instance has virtual functions where will the VFT go and what > allocates it? Ditto any non primitive types which may cause an implcit cascade > of allocations. Just don't see how we know that int y = f(x); doesn't call other functions that allocate structs on the heap? Structs that contain function pointers that are then called, cause an implicit cascade of allocations. > > People like yourself and Bonita just don't seem to get the fact that there's no > safety net inside ring 0 code. You can't just handwave away stuff that in > application code would be taken care of by the runtime. > You can look at the class declaration to see what the constructor does - and that there are no virtual functions present. Just like you have to verify what the C function does.