gnucobol-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GnuCOBOL-Dev] GnuCOBOL from trunk: system routines


From: Simon Sobisch
Subject: [GnuCOBOL-Dev] GnuCOBOL from trunk: system routines
Date: Sun, 1 Sep 2019 20:16:43 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

Hi Ron,

I've just recognized a *potential* problem with one of your old changes
in the system routine handling, the signatures are similar to

int
cob_sys_xor (const void *p1, void *p2, const int length)

up to your change those all were used (they are still generated in the
calling COBOL program), but now only "length" is used, the data pointers
are set from the COBOL call hierarchy:

        data_1 = cob_get_param_data (1);
        data_2 = cob_get_param_data (2);

What was the issue to solve here?

The *potential* issue is that those *may* be called outside of normal
COBOL programs, too.

Do we care?

In general for the case of static linking (which is implied for system
routines CALLed by literal, which is the most common way for those to be
called) all parameter-checks should be done at compile-time (we
currently miss to check for OMITTED and wrong parameter length, the
second will break the system in most cases), the additional run-time
checks seem to be less useful here - and using the simple pointers would
be a good way in this case.
So maybe having the "old" signature exported as before and used the same
way (directly accessing the pointers) and a new one only contained in
cob_local that will be called for dynamic CALL, resolving the pointers
by cob_get_param_data and then calling the "normal" one?

The reason I've stumbled over this was a compiler warning about unused
variables...

Simon



reply via email to

[Prev in Thread] Current Thread [Next in Thread]