Path: ...!3.eu.feeder.erje.net!feeder.erje.net!news.in-chemnitz.de!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.arch Subject: Re: Computer architects leaving Intel... Date: Tue, 3 Sep 2024 21:08:31 +0300 Organization: Tidorum Ltd Lines: 28 Message-ID: References: <2024Aug30.161204@mips.complang.tuwien.ac.at> <2024Aug30.195831@mips.complang.tuwien.ac.at> <2024Aug31.170347@mips.complang.tuwien.ac.at> <8lcadjhnlcj5se1hrmo232viiccjk5alu4@4ax.com> <17d615c6a9e70e9fabe1721c55cfa176@www.novabbs.org> <86v7zep35n.fsf@linuxsc.com> <20240902180903.000035ee@yahoo.com> <86r0a2otte.fsf@linuxsc.com> <86ed61pfus.fsf@linuxsc.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net o0Ln1ju21z2wCRGLI6rwrgPBeCpSwVWkXMq6XXdpfina5IZRZ4 Cancel-Lock: sha1:mec7wwXI5MpSDsySMFNKY9lLqqw= sha256:Ns9J2fbyN+um6B5BpozGyU7ZgFbPkO3kXStLfqnQ5p0= User-Agent: Mozilla Thunderbird Content-Language: en-US In-Reply-To: Bytes: 2892 On 2024-09-03 11:10, David Brown wrote: [snip] > (There are a few situations where UB in C could be diagnosed at > compile-time, which are probably historical decisions to avoid imposing > too much work on early compilers.  Where possible, UB that can be caught > at compile time, could usefully be turned into constrain violations that > must be diagnosed.) The problem, as you of course know, is that the "can" in "can be caught at compile time" depends on the amount and kind of analysis that is done at compile time -- some cases of UB "can" be caught at compile time but only by advanced and costly analysis. If the language standard requires that such things /must/ be detected by the compiler, it can place quite a burden on the developers of conforming compilers. As I understand it, current C compilers detect UB mostly as a side effect of the analyses they do for code optimization purposes, which vary widely between compilers, and so the UB-detections also vary. This issue (compile-time detection) has now and then been discussed in the Ada standards group. Given the currently low market penetration of Ada, the group has been reluctant to require too much of the compilers, and so the more advanced UB-detecting tools are stand-alone, such as the SPARK tools.