From: jameskuyper@alumni.caltech.edu   
      
   On 2026-01-14 04:03, Michael S wrote:   
   > On Tue, 13 Jan 2026 21:24:16 -0500   
   > "James Russell Kuyper Jr." wrote:   
   ...   
   >> I'm quite positive that you would consider anything that might give   
   >> unexpected behavior to such code to be "crazy". The simplest example   
   >> I can think of is that unsigned int is big-endian, while unsigned   
   >> long is little-endian, and I would even agree that such an   
   >> implementation would be peculiar, but such an implementation could be   
   >> fully conforming to the C standard.   
   >>   
   >   
   > You are inventive!   
      
   As a programmer, I paid close attention to what was and was not   
   guaranteed about the software that I used. As a result, I've noticed   
   many things, such as the fact that the standard imposes no requirements   
   on the order of the bytes (or even of the bits) that are used to   
   represent arithmetic values.   
      
   ...   
   >> Which is precisely what's wrong about your approach - it relies upon   
   >> intimate knowledge of the ABI. Specifically, it relies on unsigned   
   >> int and unsigned long happening to have exactly the same size and   
   >> representation.   
   >>   
   >   
   > I consider the latter a basic knowledge of ABI rather than an intimate.   
   > For me programming feels uncomfortable without such knowledge. That is,   
   > I can manage without, but do not want to.   
   > Your mileage appears to vary.   
   I've spent most of my career working under rules that explicitly   
   prohibited me from writing code that depends upon such details. As a   
   result, I actually have relatively little knowledge of how any   
   particular implementation of C that I used decided to handle issues that   
   the C standard left unspecified. I've always written my code so that it   
   would do what it's supposed to do, regardless of which choices any given   
   implementation made about things that are unspecified.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|