Deutsch   English   Français   Italiano  
<vbbo4g$8j04$2@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder8.news.weretis.net!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: Thu, 5 Sep 2024 09:54:56 +0200
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <vbbo4g$8j04$2@dont-email.me>
References: <2024Aug30.161204@mips.complang.tuwien.ac.at>
 <vb00c2$150ia$1@dont-email.me>
 <505954890d8461c1f4082b1beecd453c@www.novabbs.org>
 <vb0kh2$12ukk$1@dont-email.me> <vb3smg$1ta6s$1@dont-email.me>
 <vb4q5o$12ukk$3@dont-email.me> <vb6a16$38aj5$1@dont-email.me>
 <vb7evj$12ukk$4@dont-email.me> <vb8587$3gq7e$1@dont-email.me>
 <vb91e7$3o797$1@dont-email.me> <vb9eeh$3q993$1@dont-email.me>
 <vb9l7k$3r2c6$2@dont-email.me> <vba26l$3te44$1@dont-email.me>
 <vbag2s$3vhih$1@dont-email.me> <vS3CO.10106$kow1.6330@fx35.iad>
 <vbauo3$18sj$1@dont-email.me>
 <a2d65085c90f4d93f3d70df3121adc59@www.novabbs.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 05 Sep 2024 09:54:56 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="622309b8b3e203ac6e38dece30d12fb2";
	logging-data="281604"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19OamNjF5pwePmUhMdOjAf/J8LOmqZJmwk="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Cancel-Lock: sha1:ycE7dEeBi4y3pRgN6uP3Lbuj4IA=
In-Reply-To: <a2d65085c90f4d93f3d70df3121adc59@www.novabbs.org>
Content-Language: en-GB
Bytes: 2837

On 05/09/2024 02:56, MitchAlsup1 wrote:
> On Thu, 5 Sep 2024 0:41:36 +0000, BGB wrote:
> 
>> On 9/4/2024 3:59 PM, Scott Lurndal wrote:
>>
>> Say:
>>    long z;
>>    int x, y;
>>    ...
>>    z=x*y;
>> Would auto-promote to long before the multiply.
> 
> \I may have to use this as an example of C allowing the programmer
> to shoot himself in the foot; promotion or no promotion.

You snipped rather unfortunately here - it makes it look like this was 
code that Scott wrote, and you've removed essential context by BGB.


While I agree it is an example of the kind of code that people sometimes 
write when they don't understand C arithmetic, I don't think it is 
C-specific.  I can't think of any language off-hand where expressions 
are evaluated differently depending on types used further out in the 
expression.  Can you give any examples of languages where the equivalent 
code would either do the multiplication as "long", or give an error so 
that the programmer would be informed of their error?



(I don't count personal one-person languages here.  They are very rarely 
formally or accurately specified.)