Skip to content

Commit db9d3c4

Browse files
Merge pull request #94 from yutaro-sakamoto/fix_some_tests
2 parents 67c3aa4 + 1dfafd6 commit db9d3c4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+105
-9686
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,4 @@ bin/.deps/
6666
bin/cob-config
6767
bin/cobcrun
6868
bin/cobcrun-cobcrun.o
69+
configure~

ChangeLog

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

37
* opensource COBOL 4J v1.0.8 released.

NEWS

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
NEWS - user visible changes -*- outline -*-
22

3+
* opensource COBOL 4J 1.0.9
4+
5+
** New Features
6+
(1) Implement -constant option and $IF macro
7+
(2) Improve the readability of Shift_JIS string literals in generated Java files
8+
9+
** Bug fixes
10+
(1) Fix some mathematical functions
11+
(2) Fix error messages for invalid MOVE statements
12+
(3) Fix some broken tests
13+
14+
** Miscellaneous
15+
(1) Remove some unused variables in generated Java files
16+
(2) Fix some warning messages of make command
17+
18+
-----------------------------------------------------------------------
19+
320
* opensource COBOL 4J 1.0.8
421

522
** New Features

bin/cobjrun.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
#include <stdio.h>
2626
#include <string.h>
27+
#include <stdlib.h>
2728

2829
#include "tarstamp.h"
2930

cobj/cobj.c

Lines changed: 4 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ int cb_saveargc;
163163
char **cb_saveargv;
164164

165165
const char *cob_config_dir;
166-
extern char *cb_java_package_name = NULL;
166+
char *cb_java_package_name = NULL;
167167

168168
char edit_code_command[512];
169169
char edit_code_command_is_set = 0;
@@ -235,15 +235,6 @@ static const char *cob_tmpdir; /* /tmp */
235235

236236
static struct filename *file_list;
237237

238-
/* NOTE fcopts MUST have at least one leading space */
239-
#if defined(__GNUC__) && (__GNUC__ >= 3)
240-
static const char fcopts[] = " -finline-functions -fno-gcse -freorder-blocks ";
241-
#elif defined(__xlc__)
242-
static const char fcopts[] = " -Q -qro -qroconst ";
243-
#else
244-
static const char fcopts[] = " ";
245-
#endif
246-
247238
#if defined(__GNUC__) && (__GNUC__ >= 3)
248239
static const char gccpipe[] = "-pipe";
249240
#else
@@ -756,7 +747,7 @@ static void cobc_print_version(void) {
756747
#endif /*I18N_UTF8*/
757748
puts("----");
758749
printf("cobj (%s) %s\n", PACKAGE_NAME, PACKAGE_VERSION);
759-
puts("Copyright (C) 2021-2022 TOKYO SYSTEM HOUSE CO.,LTD.");
750+
puts("Copyright (C) 2021-2023 TOKYO SYSTEM HOUSE CO.,LTD.");
760751
printf("Built %s\n", cb_oc_build_stamp);
761752
}
762753

@@ -784,6 +775,8 @@ static void cobc_print_usage(void) {
784775
puts(_(" --list-reserved Display reserved words"));
785776
puts(
786777
_(" -assign_external Set the file assign to external"));
778+
puts(_(" -constant Define <name> to <value> for $IF "
779+
"statement"));
787780
puts(_(" -java-package(=<package name>) Specify the package name of the "
788781
"generated source code"));
789782
// puts(_(" -edit-code-command(=<command>) Specify the command to edit
@@ -1526,25 +1519,12 @@ static int preprocess(struct filename *fn) {
15261519
return 0;
15271520
}
15281521

1529-
static struct cb_program *program_list_reverse(struct cb_program *p) {
1530-
struct cb_program *next;
1531-
struct cb_program *last = NULL;
1532-
1533-
for (; p; p = next) {
1534-
next = p->next_program;
1535-
p->next_program = last;
1536-
last = p;
1537-
}
1538-
return last;
1539-
}
1540-
15411522
static int process_translate(struct filename *fn) {
15421523
struct cb_program *p;
15431524
struct cb_program *q;
15441525
struct cb_program *r;
15451526
struct handler_struct *hstr1;
15461527
struct handler_struct *hstr2;
1547-
struct local_filename *lf;
15481528
int ret;
15491529
int i;
15501530

@@ -1643,30 +1623,6 @@ static int process_compile(struct filename *fn) {
16431623
return ret;
16441624
}
16451625

1646-
/* Create single-element assembled object */
1647-
1648-
static int process_assemble(struct filename *fn) {
1649-
char buff[COB_MEDIUM_BUFF];
1650-
1651-
#ifdef _MSC_VER
1652-
sprintf(buff,
1653-
gflag_set ? "%s /c %s %s /Od /MDd /Zi /FR /Fo\"%s\" \"%s\""
1654-
: "%s /c %s %s /MD /Fo\"%s\" \"%s\"",
1655-
cob_cc, cob_java_flags, cob_define_flags, fn->object, fn->translate);
1656-
#else
1657-
if (cb_compile_level == CB_LEVEL_MODULE ||
1658-
cb_compile_level == CB_LEVEL_LIBRARY) {
1659-
sprintf(buff, "%s %s -c %s %s %s -o \"%s\" \"%s\"", cob_cc, gccpipe,
1660-
cob_java_flags, cob_define_flags, COB_PIC_FLAGS, fn->object,
1661-
fn->translate);
1662-
} else {
1663-
sprintf(buff, "%s %s -c %s %s -o \"%s\" \"%s\"", cob_cc, gccpipe,
1664-
cob_java_flags, cob_define_flags, fn->object, fn->translate);
1665-
}
1666-
#endif
1667-
return process(buff);
1668-
}
1669-
16701626
static int process_build_module(struct filename *fn) {
16711627
int ret;
16721628
char buff[COB_MEDIUM_BUFF];
@@ -1710,66 +1666,6 @@ static int process_build_module(struct filename *fn) {
17101666
return ret;
17111667
}
17121668

1713-
/* Create single-element loadable object */
1714-
1715-
static int process_module(struct filename *fn) {
1716-
int ret;
1717-
char buff[COB_MEDIUM_BUFF];
1718-
char name[COB_MEDIUM_BUFF];
1719-
1720-
if (output_name) {
1721-
strcpy(name, output_name);
1722-
#if defined(_MSC_VER)
1723-
file_stripext(name);
1724-
#else
1725-
if (strchr(output_name, '.') == NULL) {
1726-
strcat(name, ".");
1727-
strcat(name, COB_MODULE_EXT);
1728-
}
1729-
#endif
1730-
} else {
1731-
file_basename(fn->source, name);
1732-
#if !defined(_MSC_VER)
1733-
strcat(name, ".");
1734-
strcat(name, COB_MODULE_EXT);
1735-
#endif
1736-
}
1737-
#ifdef _MSC_VER
1738-
sprintf(buff,
1739-
gflag_set ? "%s /Od /MDd /LDd /Zi /FR /Fe\"%s\" %s \"%s\" %s"
1740-
: "%s /MD /LD /Fe\"%s\" %s \"%s\" %s",
1741-
cob_cc, name, cob_ldflags, fn->object, cob_libs);
1742-
ret = process(buff);
1743-
#if _MSC_VER >= 1400
1744-
/* Embedding manifest */
1745-
if (ret == 0) {
1746-
sprintf(buff,
1747-
"%s /manifest \"%s.dll.manifest\" /outputresource:\"%s.dll\";#2",
1748-
manicmd, name, name);
1749-
ret = process(buff);
1750-
sprintf(buff, "%s.dll.manifest", name);
1751-
cobc_check_action(buff);
1752-
}
1753-
#endif
1754-
sprintf(buff, "%s.exp", name);
1755-
cobc_check_action(buff);
1756-
sprintf(buff, "%s.lib", name);
1757-
cobc_check_action(buff);
1758-
#else /* _MSC_VER */
1759-
sprintf(buff, "%s %s %s %s %s %s -o %s %s %s", cob_cc, gccpipe,
1760-
COB_SHARED_OPT, cob_ldflags, COB_PIC_FLAGS, COB_EXPORT_DYN, name,
1761-
fn->object, cob_libs);
1762-
ret = process(buff);
1763-
#ifdef COB_STRIP_CMD
1764-
if (strip_output && ret == 0) {
1765-
sprintf(buff, "%s %s", COB_STRIP_CMD, name);
1766-
ret = process(buff);
1767-
}
1768-
#endif
1769-
#endif /* _MSC_VER */
1770-
return ret;
1771-
}
1772-
17731669
static int process_library(struct filename *l) {
17741670
char *buffptr;
17751671
char *objsptr;

0 commit comments

Comments
 (0)