Skip to content

Commit

Permalink
Merge SVN 4098, 4101
Browse files Browse the repository at this point in the history
  • Loading branch information
ddeclerck committed Jun 12, 2024
1 parent 07f5c3f commit 4dd3753
Show file tree
Hide file tree
Showing 10 changed files with 564 additions and 455 deletions.
11 changes: 10 additions & 1 deletion cobc/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -938,6 +938,15 @@
one with additional possible NAME ... IS OMITTED and
without GENERATE XML checks

2020-12-17 Simon Sobisch <[email protected]>

bug #571 revised:
* typeck.c (create_implicit_assign_dynamic_var): add ASSIGN name as
implicit VALUE clause for the implicit variable providing a
reasonable (expected) default if not manually set
* warning.def (implicit-define): changed from "always on" to "only upon
request" as the unexpected "inconsistent empty filename" was fixed

2020-12-15 Simon Sobisch <[email protected]>

* typeck.c [!COB_ALLOW_UNALIGNED]: fixed unused variable warning
Expand Down Expand Up @@ -1343,7 +1352,7 @@
2020-07-26 Edward Hart <[email protected]>

* config.def: added possible values for assign-clause and
screen-section-rules.
screen-section-rules

2020-07-21 Simon Sobisch <[email protected]>

Expand Down
4 changes: 3 additions & 1 deletion cobc/typeck.c
Original file line number Diff line number Diff line change
Expand Up @@ -3804,6 +3804,7 @@ create_implicit_assign_dynamic_var (struct cb_program * const prog,
{
cb_tree x;
struct cb_field *p;
const char *assign_name = CB_NAME (assign);

cb_warning (cb_warn_implicit_define,
_("variable '%s' will be implicitly defined"), CB_NAME (assign));
Expand All @@ -3812,8 +3813,9 @@ create_implicit_assign_dynamic_var (struct cb_program * const prog,
#if 0
p->count++;
#endif
x = CB_TREE (build_literal (CB_CATEGORY_ALPHANUMERIC, assign_name, strlen (assign_name)));
p->values = CB_LIST_INIT (x);
CB_FIELD_ADD (prog->working_storage, p);

}

static void
Expand Down
4 changes: 2 additions & 2 deletions cobc/warning.def
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ CB_WARNDEF (cb_warn_parentheses, "parentheses",
CB_WARNDEF (cb_warn_strict_typing, "strict-typing",
_(" -Wstrict-typing warn strictly about type mismatch"))

CB_ONWARNDEF (cb_warn_implicit_define, "implicit-define",
_(" -Wno-implicit-define do not warn when data items are implicitly defined"))
CB_NOWARNDEF (cb_warn_implicit_define, "implicit-define",
_(" -Wimplicit-define warn about implicitly defined data items"))

CB_ONWARNDEF (cb_warn_corresponding, "corresponding",
_(" -Wno-corresponding do not warn about CORRESPONDING with no matching items"))
Expand Down
7 changes: 7 additions & 0 deletions tests/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@

* testsuite.src/run_file.at: Added test cases for COMMIT/ROLLBACK

2020-12-20 Simon Sobisch <[email protected]>

* testsuite.src/run_extensions.at, testsuite.src/run_file.at:
moved ASSIGN related tests to run_file.at
* testsuite.src/run_misc.at: work around bug for CANCEL in test
"Recursive CALL of RECURSIVE program" by disabling that side-tests

2020-12-04 Ron Norman <[email protected]>

* testsuite.src/run_misc.at: corrected for 32/64-bit by removing pointer
Expand Down
14 changes: 12 additions & 2 deletions tests/testsuite.src/listings.at
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,12 @@ AT_DATA([prog.cob], [
STOP RUN.
])

AT_CHECK([$COMPILE_ONLY -t prog.lst prog.cob], [1], [], [ignore])
AT_CHECK([$COMPILE_ONLY -Wimplicit-define -t prog.lst prog.cob], [1], [],
[copy.inc:8: error: syntax error, unexpected Identifier, expecting DYNAMIC or RANDOM or SEQUENTIAL
copy.inc:5: error: missing file description for FILE testfile
prog.cob:7: warning: variable 'filename' will be implicitly defined
prog.cob:8: error: 'FIRST-MATCH' is not defined
])

AT_DATA([prog12.lst],
[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY Page 0001
Expand Down Expand Up @@ -1097,7 +1102,12 @@ prog.cob:8: error: 'FIRST-MATCH' is not defined

AT_CHECK([gcdiff prog12.lst prog.lst], [0], [], [])

AT_CHECK([$COMPILE_ONLY -T prog.lst prog.cob], [1], [], [ignore])
AT_CHECK([$COMPILE_ONLY -Wimplicit-define -T prog.lst prog.cob], [1], [],
[copy.inc:8: error: syntax error, unexpected Identifier, expecting DYNAMIC or RANDOM or SEQUENTIAL
copy.inc:5: error: missing file description for FILE testfile
prog.cob:7: warning: variable 'filename' will be implicitly defined
prog.cob:8: error: 'FIRST-MATCH' is not defined
])

AT_DATA([prog13.lst],
[GnuCOBOL V.R.P prog.cob DDD MMM dd HH:MM:SS YYYY Page 0001
Expand Down
Loading

0 comments on commit 4dd3753

Please sign in to comment.