Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: moi Newsgroups: alt.folklore.computers,comp.os.linux.misc Subject: Re: The joy of FORTRAN Date: Thu, 3 Oct 2024 17:32:02 +0100 Lines: 38 Message-ID: References: <5mqdnZuGq4lgwm_7nZ2dnZfqnPSdnZ2d@earthlink.com> <36KdnVlGJu9VLW77nZ2dnZfqn_qdnZ2d@earthlink.com> <971448126.749088380.092448.peter_flass-yahoo.com@news.eternal-september.org> <59CJO.19674$MoU3.15170@fx36.iad> <3hOdnWpQ649QMGr7nZ2dnZfqnPidnZ2d@earthlink.com> <1smdnSjX3YoxgWf7nZ2dnZfqn_idnZ2d@earthlink.com> <1396870532.749421730.052473.peter_flass-yahoo.com@news.eternal-september.org> <6tydnW_-XuPramH7nZ2dnZfqn_WdnZ2d@earthlink.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net gh5si0HepF0ie6zvxP1hlwgJjHPZcV/VHYcAwHm/5loRTkpmqO Cancel-Lock: sha1:1uxf3MAMLG2KvfNZhluom38W17w= sha256:rwMcR90LgtEgCshJ6k0Y+IpucKGXkP486D38cRaWMAY= User-Agent: Mozilla Thunderbird Content-Language: en-GB In-Reply-To: <6tydnW_-XuPramH7nZ2dnZfqn_WdnZ2d@earthlink.com> Xref: csiph.com alt.folklore.computers:227489 comp.os.linux.misc:59001 On 02/10/2024 08:34, 186282@ud0s4.net wrote: > On 10/1/24 6:24 AM, Stefan Ram wrote: >> Peter Flass wrote or quoted: >>> The Natural Philosopher wrote: >>>> printf("hello world"); That's bug proof. >>> Wait, what? Where’s your error checking? What if your printf fails? >>> Actually that’s one of the things I like least about C. It leaves all >>> error >>> checking up to the programmer instead of having even a minimal >>> handler for >>> errors not otherwise caught. >> >>    You could write a wrapper for printf, "myprintf", >>    that will call printf and then do minimal error handling. >> >> #include >> #include >> >> int myprintf( char const * format, ... ) >> { va_list args; >>    va_start( args, format ); >>    int const result = vprintf( format, args ); >>    va_end( args ); >>    if( result < 0 )fprintf >>    ( stderr, "Error: printf failed with return code %d\n", result ); >>    return result; } > >   The whole context of 'C' was that COMPETENT PROGRAMMERS >   existed and could/would assess error conditions as THEY >   chose to do so. The reality of C is that even competent programmers find this very difficult and often make elementary mistakes with potentially serious consequences, as we see on a daily basis. -- Bill F.