Oppolzer - Informatik / Blog


Blog-Hauptseite      Neuester Artikel      Älterer Artikel      Neuerer Artikel      Älterer gleiche Kategorie      Neuerer gleiche Kategorie

PL1-L - Option DEFAULT(NULLSTRPTR(SYSNULL))

Subject:

Re: Initializing of pointers inside structures

From:

Bernd Oppolzer <bernd.oppolzer@T-ONLINE.DE>

Reply-To:

PL1 (language) discussions <PL1-L@LISTSERV.DARTMOUTH.EDU>

Date:

2014.03.29 17:24:20


R.,

thank you very much.

I didn't know about that option.  It was no surprise to me that such an option
exists.  The way how it is implemented is - as usual - very clever, especially
the STRICT suboption is very nice.

But, as I wrote already on an earlier post (at IBM main):  the compiler people
at our site will probably not accept to set such an option which changes the
behaviour; at least now it is such that that the pointers inside structures are
set to NULL().  Establishing such an option on an existing code base of several
thousand PL/1 programs sure has some risk.  IMO it requires recompile of all
sources and testing of the whole application.  This will not be done.

Let's see.

I believe there is not much more that PL/1 can do about this.  The problem with
the IBM z/OS XL/C compiler which does not allow me to do the translation from
NULL() to SYSNULL () on the C side still needs to be fixed.  (in fact, I have a
workaround for it, but there is still a compiler error when casting pointers to
unsigned ints and comparing them with constant values not in the 31 bit range).

I hope that the compiler group at our site (same as above) will send the problem
to IBM support.

I would like to thank you all again for your valuable suggestions; I learned a
lot from this list, not only now, but troughout the years.

Kind regards

Bernd



Am 29.03.2014 16:23, schrieb R.P.:
>
> Enterprise PL/I V4.4 (and back to at least V3.9)
>
> *PROCESS DEFAULT(NULLSTRPTR(SYSNULL));
>
> This suboption controls how the compiler handles null strings when
> assigned to POINTERs.
>
> Under NULLSTRPTR(SYSNULL), the result of assigning '' to a POINTER is the
> same as assigning SYSNULL() to the pointer.
>
> Under NULLSTRPTR(NULL), the result of assigning '' to a POINTER is the
> same as assigning NULL() to the pointer.
>
> Under NULLSTRPTR(STRICT), assignments and comparisons of ’’ to
> POINTERs are flagged as invalid. If the generated code is run despite
> these
> messages, the code acts as if the NULLSTRPTR(SYSNULL) was in effect.
> NULLSTRPTR(NULL) is the default.
>
> R.

Blog-Hauptseite      Neuester Artikel      Älterer Artikel      Neuerer Artikel      Älterer gleiche Kategorie      Neuerer gleiche Kategorie