This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[patch] remove unused_prefix_warnings (gcc.c, -B)



Because the -B option is heavily overloaded within gcc, it is no
longer possible to accurately determine if a -B prefix is used or not
(or if it's OK that it isn't used).  Thus, we should no longer warn if
we think a -B prefix isn't used.

Note: this warning is currently breaking libiberty's configure,
because cygwin uses -B to find crt0.o, but gcc emits the warning, and
configure thinks the compile fails, and decides that *no* headers
exist.

2000-09-08  DJ Delorie  <dj@redhat.com>

	* gcc.c (main): don't warn about unused -B prefixes
	(unused_prefix_warnings): remove

Index: gcc.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/gcc.c,v
retrieving revision 1.163
diff -p -2 -r1.163 gcc.c
*** gcc.c	2000/09/07 00:37:09	1.163
--- gcc.c	2000/09/08 19:51:45
*************** static void add_linker_option		PARAMS ((
*** 244,248 ****
  static void process_command		PARAMS ((int, const char *const *));
  static int execute			PARAMS ((void));
- static void unused_prefix_warnings	PARAMS ((struct path_prefix *));
  static void clear_args			PARAMS ((void));
  static void fatal_error			PARAMS ((int));
--- 244,247 ----
*************** add_prefix (pprefix, prefix, component, 
*** 2389,2418 ****
    (*prev) = pl;
  }
- 
- /* Print warnings for any prefixes in the list PPREFIX that were not used.  */
- 
- static void
- unused_prefix_warnings (pprefix)
-      struct path_prefix *pprefix;
- {
-   struct prefix_list *pl = pprefix->plist;
- 
-   while (pl)
-     {
-       if (pl->used_flag_ptr != 0 && !*pl->used_flag_ptr)
- 	{
- 	  if (pl->require_machine_suffix && machine_suffix)
- 	    error ("file path prefix `%s%s' never used", pl->prefix,
- 		   machine_suffix);
- 	  else
- 	    error ("file path prefix `%s' never used", pl->prefix);
- 
- 	  /* Prevent duplicate warnings.  */
- 	  *pl->used_flag_ptr = 1;
- 	}
- 
-       pl = pl->next;
-     }
- }
  
  /* Execute the command specified by the arguments on the current line of spec.
--- 2388,2391 ----
*************** main (argc, argv)
*** 5553,5560 ****
        linker_was_run = (tmp != execution_count);
      }
- 
-   /* Warn if a -B option was specified but the prefix was never used.  */
-   unused_prefix_warnings (&exec_prefixes);
-   unused_prefix_warnings (&startfile_prefixes);
  
    /* If options said don't run linker,
--- 5526,5529 ----

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]