Skip to content

Commit

Permalink
Merge SVN 4387, 4388
Browse files Browse the repository at this point in the history
  • Loading branch information
ddeclerck committed Jun 17, 2024
1 parent e974a32 commit ec5863b
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 39 deletions.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ Open Plans:
or to use an explicit format (cut at 26 characters, may raise false-positives
in listing tests) e.g. date only `-DLISTING_TIMESTAMP_FORMAT="%Y-%m-%d"`


* More notable changes

** in 64-bit environments, the maximum field size was increased from
Expand Down
8 changes: 8 additions & 0 deletions cobc/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,14 @@
* codegen.c (output_file_initialization): don't generate attribute
setting which is done in cob_file_malloc / cob_file_external_addr

2021-09-28 Simon Sobisch <[email protected]>

* cobc.c (cobc_print_info): skip initial "." when printing COB_EXE_EXT
* cobc.c (process_command_line): postpone version output for --verbose
* cobc.c (set_listing_date): use formatted instead of ANSI timestamp,
allow format to be specified at cobc compile-time via with define
LISTING_TIMESTAMP_FORMAT

2021-09-27 Simon Sobisch <[email protected]>

* typeck.c (cb_build_generic_register): handle CONSTANT
Expand Down
41 changes: 24 additions & 17 deletions cobc/cobc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2076,7 +2076,6 @@ cobc_clean_up (const int status)
static void
set_listing_date (void)
{
char *time_buff;
if (!current_compile_time.year) {
current_compile_time = cob_get_current_date_and_time();
}
Expand All @@ -2095,15 +2094,14 @@ set_listing_date (void)
}
current_compile_tm.tm_yday = current_compile_time.day_of_year;
current_compile_tm.tm_isdst = current_compile_time.is_daylight_saving_time;
time_buff = asctime (&current_compile_tm);
/* LCOV_EXCL_START */
if (!time_buff) {
strncpy (cb_listing_date, "DATE BUG, PLEASE REPORT", CB_LISTING_DATE_MAX);
return;
}
/* LCOV_EXCL_STOP */
*strchr (time_buff, '\n') = '\0';
strncpy (cb_listing_date, time_buff, CB_LISTING_DATE_MAX);

#ifdef LISTING_TIMESTAMP_ANSI
#define LISTING_TIMESTAMP_FORMAT "%a %b %d %H:%M:%S %Y" /* same format as asctime */
#elif !defined (LISTING_TIMESTAMP_FORMAT)
#define LISTING_TIMESTAMP_FORMAT "%a %b %d %Y %H:%M:%S"
#endif
strftime (cb_listing_date, (size_t)CB_LISTING_DATE_MAX,
LISTING_TIMESTAMP_FORMAT, &current_compile_tm);
}


Expand Down Expand Up @@ -2450,7 +2448,11 @@ cobc_print_info (void)
}
cobc_var_print ("COB_OBJECT_EXT", COB_OBJECT_EXT, 0);
cobc_var_print ("COB_MODULE_EXT", COB_MODULE_EXT, 0);
cobc_var_print ("COB_EXE_EXT", COB_EXE_EXT, 0);
if (!verbose_output && COB_EXE_EXT[0] == '.') {
cobc_var_print ("COB_EXE_EXT", COB_EXE_EXT + 1, 0);
} else {
cobc_var_print ("COB_EXE_EXT", COB_EXE_EXT, 0);
}

#ifdef COB_64_BIT_POINTER
cobc_var_print ("64bit-mode", _("yes"), 0);
Expand Down Expand Up @@ -2878,10 +2880,17 @@ process_command_line (const int argc, char **argv)

case '?':
/* Unknown option or ambiguous */
if (verbose_output >= 1) {
cobc_print_shortversion ();
}
cobc_early_exit (EXIT_FAILURE);

case 'h':
/* --help */
if (verbose_output >= 1) {
cobc_print_shortversion ();
puts ("\n");
}
cobc_print_usage (argv[0]);
if (verbose_output) {
puts ("\n");
Expand Down Expand Up @@ -3018,14 +3027,8 @@ process_command_line (const int argc, char **argv)
cobc_err_exit (COBC_INV_PAR, "-verbose");
}
verbose_output = n;
if (verbose_output >= 1) {
cobc_print_shortversion ();
}
} else {
verbose_output++;
if (verbose_output == 1) {
cobc_print_shortversion ();
}
}
break;

Expand Down Expand Up @@ -3135,6 +3138,10 @@ process_command_line (const int argc, char **argv)
}
}

if (verbose_output >= 1) {
cobc_print_shortversion ();
}

/* Load default configuration file if necessary */
if (cb_config_name == NULL
&& cob_std_conf[0] > ' ') {
Expand Down
42 changes: 21 additions & 21 deletions cobc/tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,40 +153,40 @@ enum cb_tag {
/* Call convention bits */
/* Bit number Meaning Value */
/* 0 currently ignored by GC */
/* Parameter order 0 - Right to left */
/* 1 - Left to right */
/* Parameter order 0 - Right to left */
/* 1 - Left to right */
/* 1 currently ignored by GC */
/* Stack manipulation 0 - Caller removes params */
/* 1 - Callee removes params */
/* 2 RETURN-CODE update 0 - Updated */
/* 1 - Not updated */
/* Stack manipulation 0 - Caller removes params */
/* 1 - Callee removes params */
/* 2 RETURN-CODE update 0 - Updated */
/* 1 - Not updated */
/* 3 Linking behaviour 0 - Normal linking */
/* 1 - Static CALL linking */
/* 1 - Static CALL linking */
/* 4 currently ignored by GC + MF */
/* OS/2 Optlink 0 - ?? */
/* 1 - ?? */
/* OS/2 Optlink 0 - ?? */
/* 1 - ?? */
/* 5 currently ignored by GC + MF */
/* Thunked to 16 bit 0 - No thunk */
/* 1 - Thunk */
/* Thunked to 16 bit 0 - No thunk */
/* 1 - Thunk */
/* 6 GC: works both with static/dynamic calls */
/* MF: this has his has no effect on dynamic calls */
/* STDCALL convention 0 - CDECL */
/* 1 - STDCALL */
/* STDCALL convention 0 - CDECL */
/* 1 - STDCALL */
/* 7 currently ignored by GC + MF */
/* 8 currently ignored by GC */
/* parameter-count for individual entry points 0 - checked */
/* 1 - not checked */
/* parameter-count for individual entry points 0 - checked */
/* 1 - not checked */
/* 9 currently ignored by GC */
/* case of call + program names 0 - disregarded (depending on compile time flags) */
/* 1 - regarded */
/* case of call + program names 0 - disregarded (depending on compile time flags) */
/* 1 - regarded */
/* 10 currently ignored by GC */
/* RETURN-CODE storage 0 - passed as return value */
/* 1 - passed in the first parameter */
/* RETURN-CODE storage 0 - passed as return value */
/* 1 - passed in the first parameter */
/* 11-14 currently ignored by GC+MF */
/* 15 GC: enabling COBOL parameter handling for external callers */
/* 15 GC: enabling COBOL parameter handling for external callers, likely dropped with GC4 */
/* currently ignored by MF */
/* 0 - external callers don't set cob_call_params */
/* 1 - external callers set cob_call_params - standard (!)*/
/* 1 - external callers set cob_call_params - standard (!) */

#define CB_CONV_L_TO_R (1 << 0)
#define CB_CONV_CALLEE_STACK (1 << 1)
Expand Down
3 changes: 3 additions & 0 deletions tests/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
2021-09-28 Simon Sobisch <[email protected]>

* atlocal.in: workaround for MSYS issues
* listings-sed.sh: adjusted replacement to actually check the year and
convert the final timestamp in default format to ANSI format
for matching testsuite reference

2021-09-25 Ron Norman <[email protected]>

Expand Down
2 changes: 1 addition & 1 deletion tests/atlocal.in
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ for cobenv in $(${LOCAL_ENV} ${ABS_COBCRUN} --runtime-conf \
done

# prevent multiple calls by caching the output
${LOCAL_ENV} ${ABS_COBC} --info > info.out
${LOCAL_ENV} ${ABS_COBC} --verbose --info > info.out

# ... and also unset for the compiler
if test "$GNUCOBOL_TEST_LOCAL" != "1"; then
Expand Down

0 comments on commit ec5863b

Please sign in to comment.