Skip to content
Snippets Groups Projects
Commit e271ed0d authored by rdubner's avatar rdubner
Browse files

-main and -nomain options

parent f4945529
No related branches found
No related tags found
No related merge requests found
......@@ -269,6 +269,9 @@ cobol_langhook_handle_option (size_t scode,
register_main_switch(cobol_main_string);
return true;
case OPT_nomain:
return true;
case OPT_finternal_ebcdic:
parser_internal_is_ebcdic(true);
return true;
......
......@@ -15,7 +15,7 @@
.Op Fl main
.Op Fl main Ns Li = Ns Ar filename
.Op Fl main Ns Li = Ns Ar filename:program-id
.Op Fl no-main
.Op Fl nomain
.Op Fl fcobol-exceptions Ar mask
.Op Fl ffixed-form | Fl ffree-free
.Op Fl findicator-column
......@@ -38,7 +38,7 @@ to \*[lang] are listed below.
The next program file's .o object module will include a main() entry point
calling the first program-id in the program file.
.Pp
When there are no -no-main, -c, -shared, or explicit -main options present,
When there are no -nomain, -c, -shared, or explicit -main options present,
an implicit -main is inserted before the first source file name.
.It Fl main Ns Li = Ns Ar filename
The .o object module for
......@@ -52,10 +52,10 @@ will include a main() entry point that calls the
.Ar program-id
entry point in
.Ar filename
.It Fl no-main
.It Fl nomain
No main() entry point will be generated by this
compilation. An explicit no-main option is incompatible with the -main options. no-main
is implied by the -shared option. no-main is implied by the -c option when there
compilation. An explicit -nomain option is incompatible with the -main options. -nomain
is implied by the -shared option. -nomain is implied by the -c option when there
is no explicit -main option.
.It Fl D Ar name Ns Op Li = Ns Ar expr
Define a CDF name (for use with
......
/*
/*
* Copyright (c) 2021-2023 Symas Corporation
*
......@@ -412,7 +413,7 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
n_outfiles += 1;
break;
case OPT_no_main:
case OPT_nomain:
saw_OPT_no_main = true;
break;
......@@ -576,6 +577,10 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
prior_main = true;
break;
case OPT_nomain:
append_arg(decoded_options[i]);
break;
case OPT_x:
language = decoded_options[i].arg;
append_arg(decoded_options[i]);
......
......@@ -40,7 +40,6 @@
"%{ffixed-form} %{ffree-form} "
"%{preprocess} "
"%{dialect} "
"%{nomain} "
"%{!fsyntax-only:%(invoke_as)} "
"%{main} "
"%{no-main} "
, 0, 0, 0},
......@@ -115,14 +115,14 @@ Cobol Joined Separate
main
Cobol
-main The first program-id in the next source file is called by a generated main() entry point
-mainbob The first program-id in the next source file is called by a generated main() entry point
main=
Cobol Joined Var(cobol_main_string)
-main=<source_file> source_file/PROGRAM-ID is called by the generated main()
-mainbob=<source_file> source_file/PROGRAM-ID is called by the generated main()
no-main
nomain
Cobol
-no-main No main() function is created from COBOL source files
-nomain No main() function is created from COBOL source files
; This comment is to ensure we retain the blank line above.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment