Deutsch English Français Italiano |
<vb927t$3nlvo$5@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: David Brown <david.brown@hesbynett.no> Newsgroups: comp.arch Subject: Re: Computer architects leaving Intel... Date: Wed, 4 Sep 2024 09:29:01 +0200 Organization: A noiseless patient Spider Lines: 25 Message-ID: <vb927t$3nlvo$5@dont-email.me> References: <2024Aug30.161204@mips.complang.tuwien.ac.at> <memo.20240830164247.19028y@jgd.cix.co.uk> <vasruo$id3b$1@dont-email.me> <2024Aug30.195831@mips.complang.tuwien.ac.at> <vat5ap$jthk$2@dont-email.me> <vaunhb$vckc$1@dont-email.me> <vautmu$vr5r$1@dont-email.me> <2024Aug31.170347@mips.complang.tuwien.ac.at> <vavpnh$13tj0$2@dont-email.me> <vb2hir$1ju7q$1@dont-email.me> <jwv34mgo7sz.fsf-monnier+comp.arch@gnu.org> <9a76aa4fdf15830a4b89aaca28e72754@www.novabbs.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 04 Sep 2024 09:29:01 +0200 (CEST) Injection-Info: dont-email.me; posting-host="0366692407b62e2f3ab0bc1ba1697c81"; logging-data="3921912"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18bWUmx9xrx7uBpnNG5cjhoUc4BhRY6QsA=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Cancel-Lock: sha1:cqbAxhkrntA5q70pnBFB5sq4Jto= In-Reply-To: <9a76aa4fdf15830a4b89aaca28e72754@www.novabbs.org> Content-Language: en-GB Bytes: 2367 On 03/09/2024 22:22, MitchAlsup1 wrote: > On Tue, 3 Sep 2024 19:30:21 +0000, Stefan Monnier wrote: > >>> Specifications are an agreement between the supplier and the client. The >> >> The problem here is that the C standard, seen as a contract, is unfair >> to the programmer, because it's so excruciatingly hard to write code >> that is guaranteed to be free from UB. > > # define int int64_t > .. > > makes it easier. That's UB, I believe :-) And it will certainly be confusing. But good use of size-specific types is helpful to writing correct code. If your calculations could conceivably overflow 32 bits, int64_t is a good choice. For smaller numbers and portable code, you might want int_fast32_t or int_fast16_t, which on most 64-bit systems will be faster than "int". You can call it /ugly/, but it's not /hard/.