C is a standardized language. IBM's main target market is programs ported from 
other platforms. I have no idea what the standard is, but IBM *may* simply be 
following it. fopen(NULL, ...) is pretty useless any way you slice it.

I have no idea what (void I)"" would mean and I don't *think* it is valid C. A 
quick test of auto foo = (void I)""; gives me a bunch of errors.

NULL is nothing special in C: it is just an alias for 0 (zero). That lead to a 
somewhat astonishing behavior in a particular situation involving overloaded 
functions, and the new (C++ only? Perhaps C also) language standards include 
nullptr, which is specifically an *address* of zero, and is a better usage than 
NULL if the meaning is "the address of nothing." That is, "you are expecting me 
to pass you an address and I am telling you that I have no address to give you."

Charles


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Paul Gilmartin
Sent: Tuesday, March 1, 2022 8:30 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: ZAD and C/C++ (was:: 2.5 Heads Up)

On Tue, 1 Mar 2022 13:28:01 +0000,  wrote:
><snip>
>ZAD is not supported on z/OS under z/VM. "    :-(
>Is there any SOD or RFE or the like for this?
></snip>
>
Many releases ago, I saw a report the C RTL treatment of following a
NULL pointer was changing.  I tested open( NULL, ... ) with releases
before and after the change.  The earlier reported Invalid Pointer; the
later Invalid Filename.  I considered the earlier more precise and
correct.  I conjecture that IBM had fecklessly accommodated
programmers accustomed to misusing NULL instead of e.g. (void I)"".

There are probably still programs that follow null pointers. What will
become of them?

I favor strict error reporting.

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to