Skip to content

Commit

Permalink
Merge SVN 3845
Browse files Browse the repository at this point in the history
  • Loading branch information
ddeclerck committed May 27, 2024
1 parent 9c40e6c commit d988722
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 7 deletions.
4 changes: 4 additions & 0 deletions cobc/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,10 @@
* cobc.c (cobc_print_info): adjusted version output for JSON and MPIR
* typeck.c: adjusted check of defines for JSON

2020-09-27 Robert Dubner <[email protected]>

* codegen.c (output_cobol_info): emit doubled backslashes for source file

2020-09-14 Simon Sobisch <[email protected]>

* cobc.c (cobc_xref_link), tree.h: changed cb_xref_elem to a dual-linked
Expand Down
24 changes: 21 additions & 3 deletions cobc/codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -8661,13 +8661,31 @@ output_c_info (void)
static void
output_cobol_info (cb_tree x)
{
const char *p = x->source_file;
if (!cb_cob_line_num) {
skip_line_num = 0;
return;
}
if (!cb_flag_c_line_directives)
sprintf (last_line_num, "#line %d \"%s\"", x->source_line, x->source_file);
output ("#line %d \"%s\"", x->source_line, x->source_file);
if (!cb_flag_c_line_directives) {
char *q = last_line_num + strlen(last_line_num);
sprintf (last_line_num, "#line %d \"", x->source_line);
while(*p){
if( *p == '\\' ){
*q++ = '\\';
}
*q++ = *p++;
}
sprintf (q, "\"");
}
output ("#line %d \"", x->source_line);

while(*p){
if( *p == '\\' ){
output("%c",'\\');
}
output("%c",*p++);
}
output("\"");
skip_line_num++;
output_newline ();
}
Expand Down
8 changes: 4 additions & 4 deletions cobc/flag.def
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,6 @@ CB_FLAG (cb_flag_sql_xfd, 1, "sql",

/* Flags with suppressed help */

CB_FLAG_ON (cb_flag_recursive_check, 1, "recursive-check",
_(" -fno-recursive-check disable check of recursive program call;\n"
" effectively compiling as RECURSIVE program"))

CB_FLAG (cb_flag_winmain, 0, "winmain",
_(" -fwinmain generate WinMain instead of main when compiling\n"
" as executable"))
Expand Down Expand Up @@ -160,6 +156,10 @@ CB_FLAG (cb_flag_source_location, 1, "source-location",
CB_FLAG (cb_flag_implicit_init, 1, "implicit-init",
_(" -fimplicit-init automatic initialization of the COBOL runtime system"))

CB_FLAG_ON (cb_flag_recursive_check, 1, "recursive-check",
_(" -fno-recursive-check disable check of recursive program call;\n"
" effectively compiling as RECURSIVE program"))

CB_FLAG (cb_flag_stack_check, 1, "stack-check",
_(" -fstack-check PERFORM stack checking\n"
" * turned on by -debug or -g"))
Expand Down

0 comments on commit d988722

Please sign in to comment.