Skip to content

Commit 6343a92

Browse files
Add exception failure to config
1 parent ae7da33 commit 6343a92

16 files changed

+61
-1
lines changed

cobc/codegen.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9206,7 +9206,8 @@ output_stmt (cb_tree x)
92069206
}
92079207
}
92089208

9209-
if (!p->ex_handler || (p->ex_handler && p->handler_type != SIZE_ERROR_HANDLER)) {
9209+
if ((!p->ex_handler || (p->ex_handler && p->handler_type != SIZE_ERROR_HANDLER))
9210+
&& cb_fatal_exceptions_fail) {
92109211
output_size_exception_handler(p);
92119212
}
92129213

cobc/config.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@ CB_CONFIG_BOOLEAN (cb_areacheck, "areacheck",
203203
" * statements must not start in Area A; and\n"
204204
" * separator periods must not be within Area A"))
205205

206+
CB_CONFIG_BOOLEAN (cb_fatal_exceptions_fail, "fatal-exceptions-fail",
207+
_("fail when a fatal exception is set and not handled in the program"))
208+
206209
/* Support flags */
207210

208211
CB_CONFIG_SUPPORT (cb_comment_paragraphs, "comment-paragraphs",

config/ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2025-10-09 Emilien Lemaire <[email protected]>
2+
3+
* general: add option fatal-exceptions-fail
4+
15

26
2025-04-22 Chuck Haatvedt <[email protected]>
37

config/acu-strict.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ pic-length: 100
4040
# Enable AREACHECK by default, for reference formats other than {fixed,free}
4141
areacheck: no # not verified yet
4242

43+
# If yes fatal exceptions will fail if left unchecked, otherwise
44+
# they will not be checked at runtime
45+
fatal-exceptions-fail: no
46+
4347
# Default assign type
4448
# Value: 'dynamic', 'external'
4549
assign-clause: dynamic

config/bs2000-strict.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ pic-length: 50
4242
# Enable AREACHECK by default, for reference formats other than {fixed,free}
4343
areacheck: yes
4444

45+
# If yes fatal exceptions will fail if left unchecked, otherwise
46+
# they will not be checked at runtime
47+
fatal-exceptions-fail: no
48+
4549
# Default assign type
4650
# Value: 'dynamic', 'external'
4751
assign-clause: external

config/cobol2002.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ pic-length: 50
4040
# Enable AREACHECK by default, for reference formats other than {fixed,free}
4141
areacheck: no
4242

43+
# If yes fatal exceptions will fail if left unchecked, otherwise
44+
# they will not be checked at runtime
45+
fatal-exceptions-fail: yes
46+
4347
# Default assign type
4448
# Value: 'dynamic', 'external'
4549
# Note: standard COBOL supports neither of them but has USING data-name for DYNAMIC

config/cobol2014.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ pic-length: 63
4040
# Enable AREACHECK by default, for reference formats other than {fixed,free}
4141
areacheck: no
4242

43+
# If yes fatal exceptions will fail if left unchecked, otherwise
44+
# they will not be checked at runtime
45+
fatal-exceptions-fail: yes
46+
4347
# Default assign type
4448
# Value: 'dynamic', 'external'
4549
# Note: standard COBOL supports neither of them but has USING data-name for DYNAMIC

config/cobol85.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ pic-length: 30
4040
# Enable AREACHECK by default, for reference formats other than {fixed,free}
4141
areacheck: yes
4242

43+
# If yes fatal exceptions will fail if left unchecked, otherwise
44+
# they will not be checked at runtime
45+
fatal-exceptions-fail: no
46+
4347
# Default assign type
4448
# Value: 'dynamic', 'external'
4549
# Note: standard COBOL supports neither of them, later have USING data-name for DYNAMIC

config/default.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ pic-length: 255
6161
# Enable AREACHECK by default, for reference formats other than {fixed,free}
6262
areacheck: no
6363

64+
# If yes fatal exceptions will fail if left unchecked, otherwise
65+
# they will not be checked at runtime
66+
fatal-exceptions-fail: yes
67+
6468
# Default assign type
6569
# Value: 'dynamic', 'external'
6670
assign-clause: dynamic

config/gcos-strict.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ pic-length: 30
3737
# Enable AREACHECK by default, for reference formats other than {fixed,free}
3838
areacheck: yes
3939

40+
# If yes fatal exceptions will fail if left unchecked, otherwise
41+
# they will not be checked at runtime
42+
fatal-exceptions-fail: no
43+
4044
assign-clause: external
4145

4246
# If yes, file names are resolved at run time using

0 commit comments

Comments
 (0)