diff options
author | pme <pme@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-01-16 06:06:29 +0000 |
---|---|---|
committer | pme <pme@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-01-16 06:06:29 +0000 |
commit | e3c5217a118ee83a586d1250cb7465b54658156b (patch) | |
tree | a167bbfc768d8c4f343151874fa10097b1ce3fc9 /gcc/gcc.c | |
parent | ef0fab3d1319582dc5a857ee88b368964374317a (diff) | |
download | gcc-e3c5217a118ee83a586d1250cb7465b54658156b.tar.gz |
2001-01-16 Phil Edwards <pme@sources.redhat.com>
* gcc.c: When -fsyntax-only is given, do not complain about
unused libraries.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39058 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r-- | gcc/gcc.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c index 34a5cfeeb9f..dc3fb94bc10 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -96,6 +96,9 @@ static char dir_separator_str[] = { DIR_SEPARATOR, 0 }; #define MIN_FATAL_STATUS 1 +/* If nonzero, -fsyntax-only was passed. */ +static int flag_syntax_only; + /* Flag saying to pass the greatest exit code returned by a sub-process to the calling program. */ static int pass_exit_codes; @@ -3155,6 +3158,11 @@ process_command (argc, argv) printf ("%s\n", spec_machine); exit (0); } + else if (strcmp (argv[i], "-fsyntax-only") == 0) + { + /* remember this so we don't complain about libraries */ + flag_syntax_only = 1; + } else if (strcmp (argv[i], "-fhelp") == 0) { /* translate_options () has turned --help into -fhelp. */ @@ -3781,6 +3789,7 @@ process_command (argc, argv) switches[n_switches].ordering = 0; /* These are always valid, since gcc.c itself understands it. */ if (!strcmp (p, "save-temps") + || !strcmp (p, "fsyntax-only") || !strcmp (p, "static-libgcc") || !strcmp (p, "shared-libgcc")) switches[n_switches].validated = 1; @@ -5849,7 +5858,7 @@ main (argc, argv) /* If options said don't run linker, complain about input files to be given to the linker. */ - if (! linker_was_run && error_count == 0) + if (! linker_was_run && error_count == 0 && flag_syntax_only == 0) for (i = 0; (int) i < n_infiles; i++) if (explicit_link_files[i]) error ("%s: linker input file unused because linking not done", |