-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add optional index check #191
base: gcos4gnucobol-3.x
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -707,7 +707,9 @@ AT_DATA([prog.cob], [ | |
STOP RUN. | ||
]) | ||
|
||
AT_CHECK([$COMPILE prog.cob], [0], [], []) | ||
AT_CHECK([$COMPILE -fopt-check-subscript-set prog.cob], [0], [], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Had to explicitly activate the flag here - but is it what we want ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does the result differ otherwise? As we found that this is a non-standard optimization it should only be enabled by explicit request. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually 4935 added the warning to this test - but to get the warning we have to add the new Maybe we can test both behaviors: without the flag and the warning (as it was before this patch), and with the flag and the warning ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, one of the point of the back-merge was that the checks and therefore the warnings should always be done, only the codegen depend on the new flag. ... but the warnings belong into a test in syn_occurs.at, not into a runtime check (please move it). And yes, the other runtime test should be done for both cases - w/wo the new option (without is missing and the compile command for the current test uses definitely more options than needed ( |
||
[prog.cob:9: warning: SET I TO 0 is out of bounds | ||
]) | ||
AT_CHECK([$COBCRUN_DIRECT ./prog], [0], [], []) | ||
|
||
AT_CLEANUP | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's where I'm wondering if the added lines above interact badly with this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to wonder (my guess is this breaks cb_subscript_check: max) - but a reason to add this into the "enable / disable subscript check with ODO" test (run_subscripts.at) tests, which should get a prog2.cob in any case that uses an index in any case (which should behave identical for the current tests but likely break with the new option [which only makes sense in the prog2.cob test as it only applies to indexes).
... while you at this: please replace the leading tabs in that test's prog.cob.