Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: =?UTF-8?Q?Arne_Vajh=C3=B8j?= Newsgroups: comp.os.vms Subject: Re: New VSI blog post Date: Wed, 31 Jul 2024 20:47:12 -0400 Organization: A noiseless patient Spider Lines: 55 Message-ID: References: <3a8759652d4cb95dbb082ab251229b39804dd554@i2pn2.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Thu, 01 Aug 2024 02:47:12 +0200 (CEST) Injection-Info: dont-email.me; posting-host="c3ea436082460bef622aadf0493fc7f7"; logging-data="1901285"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Q/le3V1RDNvNOonu7QOeeANNqIKj0Ng4=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:eEhDnmwBNdDI21Wrsb+FO1JRoHA= Content-Language: en-US In-Reply-To: Bytes: 2754 On 7/31/2024 8:42 PM, Arne Vajhøj wrote: > On 7/31/2024 4:44 PM, John Reagan wrote: >> On 7/30/2024 7:59 PM, Arne Vajhøj wrote: >>> All of the above is bad in some ways. >>> >>> Dont't ignore warnings, always include .h in implementing >>> .c, never use old style declarations without arguments and >>> don't mix VMS C and Clang C. >>> >>> But bad things has been seen out in the big world. >> >> And don't forget that /STANDARD=VAXC will cover up a ton of bad code > > :-( > > Maybe time to add this to the C compiler. > >       subroutine revenge >       character*80 std >       character*256 fnm >       integer*4 stdlen, fnmlen >       integer*4 cli$present >       if(iand(cli$present('STANDARD'),1).eq.1) then >         call cli$get_value('STANDARD', std, stdlen) >         if(std(1:stdlen).eq.'VAXC') then >           call cli$get_value('FILE', fnm, fnmlen) >           call lib$delete_file(fnm(1:fnmlen), '.c') >         endif >       end if >       end > > :-) :-) :-) > > My apologies for being in Fortran mood instead of Pascal mood. I should not not be that lazy. procedure revenge; var std, fnm : varying [255] of char; begin if odd(cli$present('STANDARD')) then begin cli$get_value('STANDARD', std.body, std.length); if std = 'VAXC' then begin cli$get_value('FILE', fnm.body, fnm.length); lib$delete_file(fnm, '.c'); end; end; end; Arne