aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorJim Wilson <wilson@cygnus.com>1998-04-18 15:31:36 +0000
committerJim Wilson <wilson@gcc.gnu.org>1998-04-18 08:31:36 -0700
commita2a05b0a358ce7cbd768224e99ea194a51e39150 (patch)
tree1e61097096d20ccacf2ba79399545d63303dccee /gcc/gcc.c
parentea16ab474b93bcb7fb7cbc58accd8490ee9b3290 (diff)
downloadgcc-a2a05b0a358ce7cbd768224e99ea194a51e39150.zip
gcc-a2a05b0a358ce7cbd768224e99ea194a51e39150.tar.gz
gcc-a2a05b0a358ce7cbd768224e99ea194a51e39150.tar.bz2
Patches to make g++/g77 give useful error when no files are given.
* gcc.c (lang_specific_driver): Add new parm type to prototype. (added_libraries): New file scope static variable. (process_command): Initialize added_libraries. Pass it to lang_specific_driver. (main): Use added_libraries in check for no input files. From-SVN: r19281
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 614553a..ab1408f 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -265,7 +265,7 @@ char *xmalloc ();
char *xrealloc ();
#ifdef LANG_SPECIFIC_DRIVER
-extern void lang_specific_driver PROTO ((void (*) (), int *, char ***));
+extern void lang_specific_driver PROTO ((void (*) (), int *, char ***, int *));
#endif
/* Specs are strings containing lines, each of which (if not blank)
@@ -2291,6 +2291,11 @@ static struct infile *infiles;
static int n_infiles;
+/* This counts the number of libraries added by LANG_SPECIFIC_DRIVER, so that
+ we can tell if there were any user supplied any files or libraries. */
+
+static int added_libraries;
+
/* And a vector of corresponding output files is made up later. */
static char **outfiles;
@@ -2373,6 +2378,7 @@ process_command (argc, argv)
n_switches = 0;
n_infiles = 0;
+ added_libraries = 0;
/* Figure compiler version from version string. */
@@ -2515,7 +2521,7 @@ process_command (argc, argv)
#ifdef LANG_SPECIFIC_DRIVER
/* Do language-specific adjustment/addition of flags. */
- lang_specific_driver (fatal, &argc, &argv);
+ lang_specific_driver (fatal, &argc, &argv, &added_libraries);
#endif
/* Scan argv twice. Here, the first time, just count how many switches
@@ -4696,7 +4702,7 @@ main (argc, argv)
exit (0);
}
- if (n_infiles == 0)
+ if (n_infiles == added_libraries)
fatal ("No input files");
/* Make a place to record the compiler output file names