A function wit id cgivalue having a linkage section defining a data name cgiValue.
Note the uppercase V. The function compiles fine.
However, adding some references in the PROCEDURE DIVISION to the dataname cgiValue:
cgiValue being a udf.syntax error, unexpected User FUNCTION in cases.Compiler fauilure unsigned char[4] not assignable in cases, when cgiValue is defined as binary-long.
Changing all the naming into CGIVALUE compiles fine, though a compiler error would be expected.
CGIVALUE gives the same results.I can't find constraints on datanames in the GC2.0 Cobol Reference manual.
Example code:
The root bugs:
cgiValuevariable is not rejected for having the same name as the functionI've been unable to reproduce these. Could you post some code which demonstrates these bugs?
Last edit: Edward Hart 2016-02-25
The example shown by Edward does not compile. There is the error on line 13
which seems to be a correct diagnose. Than changing line 13
into
gives the error on line 13
The other cases are more complicated. I'll see to show a good example.
Than, by accident, found out that these statements enjoy different compiler behaviour:
all errors with FUNCTION cgiValue' unknown. Note the lowercase v in the statement and the upercase V in the error.
all compile fine. Note the uppercase V.
Last edit: wim niemans 2016-02-25
It took a while to recall the construct I've stumbled upon. On second thought it probably doesn't have a link to upper/lower cases, but it showed in the process to find out what was happening. The problem was that the
call "cgiGetValue" using cgiName returning cgiValuepersistently errors withsyntax error, unexpected User FUNCTION, expecting IdentifieroncgiValue, and I tried something different, see below.The error received brought me to decide it was the upper/lower case of
cgiValuecausing the troubles.which shows the error, without a line reference:
Having the
PROCEDURE DIVISIONreturningcgiValue(instead ofnewValue), compiles fine, though.Finally, I am on iMac OS/X, got gnuCobol 2.0 from macports.org and I am using openCobolIDE.
Last edit: wim niemans 2016-02-26
Than. the next oddity.
Function is cgivalue returning myCgiValue.Changed the datanames from
cgiValueintomyCgiValue, but forgot one statement:The statement
display cgiValue.compiles fine, but the exec delivers a SEGV.This bugs appears fixed as of [r827]. Function-names now generate an implicit
REPOSITORYentry, which prevents users from using the same name for data items.The errors regarding
CALLare caused by program-names being matched in a case-sensitive way by default. More standard behaviour can be enabled by using-ffold-call.