home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.os.vms      DEC's VAX* line of computers & VMS.      264,096 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 263,748 of 264,096   
   =?UTF-8?Q?Arne_Vajh=C3=B8j?= to All   
   Re: VMS Bootcamp   
   12 Nov 25 19:14:29   
   
   From: arne@vajhoej.dk   
      
   On 11/12/2025 5:21 PM, Arne Vajhøj wrote:   
   > On 11/12/2025 5:14 PM, Arne Vajhøj wrote:   
   >> I do not see a problem with the pointer type casts. If   
   >> normal code is safe, then I think it is OK to have ways   
   >> to workaround the safeness. Sometimes it is desirable   
   >> and it is hopefully easy to identify usage of such   
   >> constructs and require extra code review of such code.   
   >   
   > Illustration:   
      
   So VMS Pascal is not so bad.   
      
   Delphi is pretty bad.   
      
   It seems like Delphi had as a design goal that anything   
   possible in C should be possible in Delphi.   
      
   So it add a lot of questionable features.   
      
   Making it possible to code C in Pascal.   
      
   Example:   
      
   program cinp;   
      
   var   
      p, p2 : pchar;   
      i : integer;   
      
   begin   
      GetMem(p, 4); // p = malloc(4)   
      GetMem(p2, 3); // p2 = malloc(3)   
      for i := 0 to 4 do p[i] := chr(i); // initialize elements 0..4   
      Move(p, p2, 5); // memcpy(p2, p, 5)   
      for i := 0 to 4 do writeln(ord(p2[i])); // print elements 0..4   
      FreeMem(p2); // free(p2)   
      FreeMem(p); // free(p)   
   end.   
      
   Arne   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca