Skip to content

Commit f2da033

Browse files
Merge pull request #227 from opensourcecobol/develop
V1.0.15
2 parents 5724483 + df1a408 commit f2da033

30 files changed

+1025
-80
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@
33
All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6+
## [1.0.15] - 2023-09-29
7+
### Added
8+
- Add new intrinsic functions
9+
- EXCEPTION-FILE (#218)
10+
- EXCEPTION-LOCATION (218)
11+
- EXCEPTION-STATEMENT (#221)
12+
- EXCEPTION-STATUS (#221)
13+
- FRACTION-PART (#224)
14+
- Add `-Wredefinition` option (#223)
15+
- Implement `FD` with `EXTERNAL` clause (#222)
16+
- Add a guideline for contributing (#226)
17+
### Fixed
18+
- Fix a build error on some platforms (#225)
619

720
## [1.0.14] - 2023-08-31
821
### Added

CONTRIBUTING.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
Thank you for your interest in contributing to opensource COBOL 4J.
2+
A summary of how to contribute is below.
3+
4+
# Issues
5+
6+
Although any topics related to opensource COBOL 4J can be posted in [Issues](https://github.com/opensourcecobol/opensourcecobol4j/issues), please submit ones written in English or Japanese.
7+
8+
# Pull Requests
9+
10+
We will check pull requests that passed all CI checks running both tests and static code analysis.
11+
The static analysis checks whether C and Java source files are formatted using [clang-format](https://clang.llvm.org/docs/ClangFormat.html) and [google-java-format](https://github.com/google/google-java-format) respectively, and whether [PMD](https://pmd.github.io/) finds no error and warning in Java source files.
12+
13+
The below sections describe how to setup and run static code analysis.
14+
15+
## Setup static analysis tools
16+
17+
### clang-format
18+
19+
Run `sudo apt install clang-format` in Ubuntu to install `clang-format`.
20+
21+
### google-java-format
22+
23+
Run the following command to download `google-java-format`:
24+
```sh
25+
curl -L -o google-java-format.jar https://github.com/google/google-java-format/releases/download/v1.15.0/google-java-format-1.15.0-all-deps.jar
26+
```
27+
Then set the environment variable `PATH_GOOGLE_JAVA_FORMAT` to the file path of the jar file.
28+
29+
### PMD
30+
31+
Run the following commands to install `PMD`:
32+
```sh
33+
curl -L -o pmd-bin-6.52.0.zip https://github.com/pmd/pmd/releases/download/pmd_releases%2F6.52.0/pmd-bin-6.52.0.zip
34+
unzip pmd-bin-6.52.0.zip
35+
mv pmd-bin-6.52 /usr/local/bin/
36+
rm pmd-bin-6.52.0.zip
37+
```
38+
39+
## Run static analysis
40+
41+
### clang-format and google-java-format
42+
43+
Run `./format` in the top directory of opensource COBOL 4J.
44+
If you want to make sure all files are formatted, run `./check-format` in the top directory of opensource COBOL 4J.
45+
46+
### PMD
47+
48+
Run the following command in the top directory of opensource COBOL 4J:
49+
```
50+
/usr/local/bin/pmd-bin-6.52.0/bin/run.sh -d libcobj/src -R .github/ruleset.xml -f text
51+
```

CONTRIBUTING_JP.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
opensource COBOL 4Jへのコントリビュートを検討頂きありがとうございます。
2+
下記にコントリビュートの手順を示します。
3+
4+
# Issues
5+
6+
opensource COBOL 4Jに関するトピックを投稿してください。ただし、英語か日本語での記載をお願いします。
7+
8+
# Pull Requests
9+
CIはテストとコードの静的解析を実行します。
10+
CIの静的解析はCとJavaのソースコードがそれぞれ[clang-format](https://clang.llvm.org/docs/ClangFormat.html) and [google-java-format](https://github.com/google/google-java-format)で整形されているか、
11+
[PMD](https://pmd.github.io/)によるJavaソースコードの静的解析でエラーや警告が表示されないかをチェックします。
12+
13+
下記にそれぞれのツールのセットアップと使用方法を説明します。
14+
15+
## セットアップ
16+
17+
### clang-format
18+
19+
Ubuntuでは`sudo apt install clang-format`コマンドを実行すれば`clang-format`をインストールできます。
20+
21+
### google-java-format
22+
23+
下記のコマンドを実行して`google-java-format`をダウンロードしてください。
24+
```sh
25+
curl -L -o google-java-format.jar https://github.com/google/google-java-format/releases/download/v1.15.0/google-java-format-1.15.0-all-deps.jar
26+
```
27+
さらに環境変数`PATH_GOOGLE_JAVA_FORMAT`に上記のjarファイルのファイルパスを設定してください。
28+
29+
### PMD
30+
31+
下記のコマンドを実行して`PMD`をインストールしてください。
32+
```sh
33+
curl -L -o pmd-bin-6.52.0.zip https://github.com/pmd/pmd/releases/download/pmd_releases%2F6.52.0/pmd-bin-6.52.0.zip
34+
unzip pmd-bin-6.52.0.zip
35+
mv pmd-bin-6.52 /usr/local/bin/
36+
rm pmd-bin-6.52.0.zip
37+
```
38+
39+
## 静的解析の実行
40+
41+
### clang-formatとgoogle-java-format
42+
43+
opensource COBOL 4Jのトップディレクトリで`./format`を実行してください。
44+
`./check-format`を実行することで、フォーマットが完了したかを確認できます。
45+
46+
### PMD
47+
48+
opensource COBOL 4Jのトップディレクトリで下記のコマンドを実行してください。
49+
```
50+
/usr/local/bin/pmd-bin-6.52.0/bin/run.sh -d libcobj/src -R .github/ruleset.xml -f text
51+
```

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2023-09-29 OSS Consortium <[email protected]>
2+
3+
* opensource COBOL 4J v1.0.15 released.
4+
15
2023-08-31 OSS Consortium <[email protected]>
26

37
* opensource COBOL 4J v1.0.14 released.

NEWS

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,26 @@ NEWS - user visible changes -*- outline -*-
22

33
-----------------------------------------------------------------------
44

5+
* opensource COBOL 4J 1.0.15
6+
7+
** New Features
8+
(1) Add new intrinsic functions
9+
(a) EXCEPTION-FILE
10+
(b) EXCEPTION-LOCATION
11+
(c) EXCEPTION-STATEMENT
12+
(d) EXCEPTION-STATUS
13+
(e) FRACTION-PART
14+
(2) Add -Wredefinition option
15+
(3) Implement FD with EXTERNAL clause
16+
17+
** Bug fixes
18+
(1) Fix a build error on some platforms
19+
20+
** Miscellaneous
21+
(1) Add a guidelines for contributing
22+
23+
-----------------------------------------------------------------------
24+
525
* opensource COBOL 4J 1.0.14
626

727
** New Features

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ rw 4 0 4 0 0 0 0 0 0 REPORT
8282
total 21 0 21 0 0 0 0 0 0
8383
```
8484

85-
# Contributors
85+
# Contributing
8686

87-
See https://github.com/opensourcecobol/opensourcecobol4j/graphs/contributors
87+
Guidelines for contributing to opensource COBOL 4J can be found in [CONTRIBUTING.md](./CONTRIBUTING.md).
88+
Contributors are listed in https://github.com/opensourcecobol/opensourcecobol4j/graphs/contributors

README_JP.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ rw 4 0 4 0 0 0 0 0 0 REPORT
8181
total 21 0 21 0 0 0 0 0 0
8282
```
8383

84-
# コントリビュータ
84+
# コントリビューㇳ
8585

86-
https://github.com/opensourcecobol/opensourcecobol4j/graphs/contributors を参照してください.
86+
コントリビュータの一覧は https://github.com/opensourcecobol/opensourcecobol4j/graphs/contributors に掲載されています。
87+
コントリビュータ向けのガイドラインは[CONTRIBUTING_JP.md](./CONTRIBUTING_JP.md)を参照してください。

cobj/codegen.c

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,6 +1408,7 @@ static void joutput_param(cb_tree x, int id) {
14081408
struct cb_alphabet_name *abp;
14091409
struct cb_alphabet_name *rbp;
14101410
cb_tree l;
1411+
struct literal_list *ll;
14111412
int n;
14121413
int extrefs;
14131414
int sav_stack_id;
@@ -1490,8 +1491,8 @@ static void joutput_param(cb_tree x, int id) {
14901491
joutput("%s%s", CB_PREFIX_FILE, CB_FILE(x)->cname);
14911492
break;
14921493
case CB_TAG_LITERAL:
1493-
struct literal_list *l = lookup_literal(x);
1494-
joutput_const_identifier(l);
1494+
ll = lookup_literal(x);
1495+
joutput_const_identifier(ll);
14951496
break;
14961497
case CB_TAG_FIELD:
14971498
/* TODO: remove me */
@@ -4012,13 +4013,20 @@ static void joutput_file_initialization(struct cb_file *f) {
40124013
joutput_line (" byte_%s%s[i] = '0;'");
40134014
joutput_line ("}");
40144015
}*/
4016+
if (f->external) {
4017+
joutput_line("%s%s = CobolFile.getExternalFile(\"%s\");", CB_PREFIX_FILE,
4018+
f->cname, f->cname);
4019+
joutput_line("if(%s%s == null) {", CB_PREFIX_FILE, f->cname);
4020+
joutput_indent_level += 2;
4021+
}
40154022

40164023
joutput_line("%s%s = CobolFileFactory.makeCobolFileInstance(", CB_PREFIX_FILE,
40174024
f->cname);
40184025
joutput_line("/* select_name = */ \"%s\",", f->name);
40194026
if (f->external && !f->file_status) {
4020-
joutput_line("/* file_status = */ cob_external_addr (\"%s%s_status\", 4),",
4021-
CB_PREFIX_FILE, f->cname);
4027+
joutput_line("/* file_status = */ CobolFile.getExternalFileStatus "
4028+
"(\"%s\"),",
4029+
f->cname);
40224030
} else {
40234031
joutput_line("/* file_status = */ %s%s_status,", CB_PREFIX_FILE, f->cname);
40244032
}
@@ -4076,26 +4084,15 @@ static void joutput_file_initialization(struct cb_file *f) {
40764084
joutput_line(");");
40774085

40784086
if (f->external) {
4079-
// joutput_line ("%s%s = CobolExternal.getFileAddress (\"%s\");",
4080-
// CB_PREFIX_FILE, f->cname, f->cname);
4081-
joutput_line("if (CobolExternal.initialExternal)");
4082-
joutput_indent("{");
4083-
if (f->linage) {
4084-
joutput_line("%s%s.setLinorkeyptr(new Linage());", CB_PREFIX_FILE,
4085-
f->cname);
4086-
}
4087-
} else {
4088-
// joutput_line ("if (%s%s == null)", CB_PREFIX_FILE, f->cname);
4089-
// joutput_indent ("{");
4090-
// joutput_line ("%s%s = new CobolFile();", CB_PREFIX_FILE, f->cname);
4091-
if (f->linage) {
4092-
joutput_line("%s%s.setLinorkeyptr(new Linage());", CB_PREFIX_FILE,
4093-
f->cname);
4094-
}
4095-
// joutput_indent ("}");
4087+
joutput_line("CobolFile.putExternalFile(\"%s\", %s%s);", f->cname,
4088+
CB_PREFIX_FILE, f->cname);
4089+
joutput_indent_level -= 2;
4090+
joutput_line("}");
40964091
}
40974092

40984093
if (f->linage) {
4094+
joutput_line("%s%s.setLinorkeyptr(new Linage());", CB_PREFIX_FILE,
4095+
f->cname);
40994096
joutput_line("lingptr = (Linage)(%s%s.getLinorkeyptr());", CB_PREFIX_FILE,
41004097
f->cname);
41014098
joutput_prefix();
@@ -4135,9 +4132,6 @@ static void joutput_file_initialization(struct cb_file *f) {
41354132
joutput_line("lingptr.setLinTop(0);");
41364133
joutput_line("lingptr.setLinBot(0);");
41374134
}
4138-
if (f->external) {
4139-
joutput_indent("}");
4140-
}
41414135
}
41424136

41434137
/*

cobj/warning-help.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323

2424
/* CB_WARNDEF (var, name, wall, doc) */
2525

26+
CB_WARNDEF (cb_warn_redefinition, "redefinition", 1,
27+
N_("Warn incompatible redefinition of data items"))
28+
2629
CB_WARNDEF (cb_warn_parentheses, "parentheses", 1,
2730
N_("Warn lack of parentheses around AND within OR"))
2831

configure

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.71 for opensource COBOL 4J 1.0.14.
3+
# Generated by GNU Autoconf 2.71 for opensource COBOL 4J 1.0.15.
44
#
55
# Report bugs to <[email protected]>.
66
#
@@ -620,9 +620,9 @@ MAKEFLAGS=
620620

621621
# Identity of this package.
622622
PACKAGE_NAME='opensource COBOL 4J'
623-
PACKAGE_TARNAME='opensource-cobol-4j-1.0.14'
624-
PACKAGE_VERSION='1.0.14'
625-
PACKAGE_STRING='opensource COBOL 4J 1.0.14'
623+
PACKAGE_TARNAME='opensource-cobol-4j-1.0.15'
624+
PACKAGE_VERSION='1.0.15'
625+
PACKAGE_STRING='opensource COBOL 4J 1.0.15'
626626
PACKAGE_BUGREPORT='[email protected]'
627627
PACKAGE_URL=''
628628

@@ -1414,7 +1414,7 @@ if test "$ac_init_help" = "long"; then
14141414
# Omit some internal or obsolete options to make the list less imposing.
14151415
# This message is too long to be a string in the A/UX 3.1 sh.
14161416
cat <<_ACEOF
1417-
\`configure' configures opensource COBOL 4J 1.0.14 to adapt to many kinds of systems.
1417+
\`configure' configures opensource COBOL 4J 1.0.15 to adapt to many kinds of systems.
14181418

14191419
Usage: $0 [OPTION]... [VAR=VALUE]...
14201420

@@ -1464,7 +1464,7 @@ Fine tuning of the installation directories:
14641464
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
14651465
--mandir=DIR man documentation [DATAROOTDIR/man]
14661466
--docdir=DIR documentation root
1467-
[DATAROOTDIR/doc/opensource-cobol-4j-1.0.14]
1467+
[DATAROOTDIR/doc/opensource-cobol-4j-1.0.15]
14681468
--htmldir=DIR html documentation [DOCDIR]
14691469
--dvidir=DIR dvi documentation [DOCDIR]
14701470
--pdfdir=DIR pdf documentation [DOCDIR]
@@ -1486,7 +1486,7 @@ fi
14861486

14871487
if test -n "$ac_init_help"; then
14881488
case $ac_init_help in
1489-
short | recursive ) echo "Configuration of opensource COBOL 4J 1.0.14:";;
1489+
short | recursive ) echo "Configuration of opensource COBOL 4J 1.0.15:";;
14901490
esac
14911491
cat <<\_ACEOF
14921492

@@ -1617,7 +1617,7 @@ fi
16171617
test -n "$ac_init_help" && exit $ac_status
16181618
if $ac_init_version; then
16191619
cat <<\_ACEOF
1620-
opensource COBOL 4J configure 1.0.14
1620+
opensource COBOL 4J configure 1.0.15
16211621
generated by GNU Autoconf 2.71
16221622

16231623
Copyright (C) 2021 Free Software Foundation, Inc.
@@ -2105,7 +2105,7 @@ cat >config.log <<_ACEOF
21052105
This file contains any messages produced by compilers while
21062106
running configure, to aid debugging if configure makes a mistake.
21072107

2108-
It was created by opensource COBOL 4J $as_me 1.0.14, which was
2108+
It was created by opensource COBOL 4J $as_me 1.0.15, which was
21092109
generated by GNU Autoconf 2.71. Invocation command line was
21102110

21112111
$ $0$ac_configure_args_raw
@@ -3403,8 +3403,8 @@ fi
34033403

34043404

34053405
# Define the identity of the package.
3406-
PACKAGE='opensource-cobol-4j-1.0.14'
3407-
VERSION='1.0.14'
3406+
PACKAGE='opensource-cobol-4j-1.0.15'
3407+
VERSION='1.0.15'
34083408

34093409

34103410
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@@ -25367,7 +25367,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
2536725367
# report actual input values of CONFIG_FILES etc. instead of their
2536825368
# values after options handling.
2536925369
ac_log="
25370-
This file was extended by opensource COBOL 4J $as_me 1.0.14, which was
25370+
This file was extended by opensource COBOL 4J $as_me 1.0.15, which was
2537125371
generated by GNU Autoconf 2.71. Invocation command line was
2537225372

2537325373
CONFIG_FILES = $CONFIG_FILES
@@ -25435,7 +25435,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
2543525435
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
2543625436
ac_cs_config='$ac_cs_config_escaped'
2543725437
ac_cs_version="\\
25438-
opensource COBOL 4J config.status 1.0.14
25438+
opensource COBOL 4J config.status 1.0.15
2543925439
configured by $0, generated by GNU Autoconf 2.71,
2544025440
with options \\"\$ac_cs_config\\"
2544125441

0 commit comments

Comments
 (0)