https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119885
Bug ID: 119885
Summary: libgcobol: SQRT wrong argument check
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: cobol
Assignee: unassigned at gcc dot gnu.org
Reporter: simonsobisch at gnu dot org
Target Milestone: ---
The following code works as expected as long as runtime exceptions are not
enabled:
program-id. sqbug.
procedure division.
IF FUNCTION SQRT (0) = 0 *> IF4034.2
DISPLAY 'OK' ELSE DISPLAY 'BAD'.
GOBACK.
Compiling with -fcobol-exceptions=EC-ALL raises the following runtime error,
though:
sqbug.cob:3:FUNCTION EC-ARGUMENT-FUNCTION (Function argument error)
While the standard defines
> The value of argument-1 shall be zero or positive