- 
                Notifications
    You must be signed in to change notification settings 
- Fork 25
Closed
Labels
CobolErrorMessageIssue related to error messagesIssue related to error messagesTypeCobolrfcSpecifications are not complete. Comment are welcomed.Specifications are not complete. Comment are welcomed.
Milestone
Description
Describe the bug
Our parser currently allows use of LENGTH OF in CALLs without specifying passing style BY CONTENT. This is wrong in Cobol and should be signaled with a diagnostic (error level).
To Reproduce
(Type)Cobol code that cause the bug : (if any)
       IDENTIFICATION DIVISION.
       PROGRAM-ID. Pgm1.
       DATA DIVISION.
       LOCAL-STORAGE SECTION.
       01 txt   pic X(100).
       01 l     pic S9(5) comp-5.
       01 RC    pic 99.
       PROCEDURE DIVISION.
      *KO cannot use LENGTH OF by reference
           Call "SOMEPGM" USING txt
                   by reference length of txt
                                RC.
      
      *KO cannot use LENGTH OF by reference
           Call "SOMEPGM" USING txt
                                length of txt
                                RC.
      
      *Ok
           Call "SOMEPGM" USING txt
                   by content   length of txt
                   by reference RC.
      
       END PROGRAM Pgm1.Expected behavior
Diagnostics on wrong lines with meaningful error message.
To discuss
- expected behavior for TypeCobol procedure calls
- same as Cobol ?
- allow the developer to omit the BY CONTENTbut auto-generates it ?
 
- What about ADDRESS OF?
Metadata
Metadata
Assignees
Labels
CobolErrorMessageIssue related to error messagesIssue related to error messagesTypeCobolrfcSpecifications are not complete. Comment are welcomed.Specifications are not complete. Comment are welcomed.