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 to cccp.c to display omitted default include directories


Hi Guys,

  I would like to submit the following little patch which provided
  some useful debugging information for when I was tracking down a 
  configuration problem.  The patch extends the -v output of 'cpp' so
  that it also lists the default include directories which were never
  appended to the include directory chain.

Cheers
	Nick


Tue Feb 23 14:00:40 1999  Nick Clifton  <nickc@cygnus.com>

	* cccp.c (struct default_include): Add 'included' field.
	(main): Set 'included' field when a default include directory
	is added to the chain.  If -v is specified list all default
	include directories which do not get appended to the chain.


Index: gcc/cccp.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cccp.c,v
retrieving revision 1.61
diff -p -w -r1.61 cccp.c
*** cccp.c	1999/02/15 11:58:04	1.61
--- cccp.c	1999/02/23 21:59:37
*************** static struct default_include {
*** 377,382 ****
--- 377,383 ----
    int cxx_aware;		/* Includes in this directory don't need to
  				   be wrapped in extern "C" when compiling
  				   C++.  */
+   int included;                 /* Set if the directory is acceptable.  */
  } include_defaults_array[]
  #ifdef INCLUDE_DEFAULTS
    = INCLUDE_DEFAULTS;
*************** main (argc, argv)
*** 2018,2023 ****
--- 2019,2025 ----
  	      append_include_chain (new, new);
  	      if (first_system_include == 0)
  		first_system_include = new;
+ 	      p->included = 1;
  	    }
  	  }
  	}
*************** main (argc, argv)
*** 2033,2038 ****
--- 2035,2041 ----
  	  append_include_chain (new, new);
  	  if (first_system_include == 0)
  	    first_system_include = new;
+ 	  p->included = 1;
  	}
        }
      }
*************** main (argc, argv)
*** 2059,2064 ****
--- 2062,2075 ----
  	fprintf (stderr, " %.*s\n", (int) strlen (p->fname) - 1, p->fname);
      }
      notice ("End of search list.\n");
+     {
+       struct default_include * d;
+       notice ("The following default directories have been omitted from the search path:\n");
+       for (d = include_defaults; d->fname; d++)
+ 	if (! d->included)
+ 	  fprintf (stderr, " %s\n", d->fname);
+       notice ("End of omitted list.\n");
+     }
    }
  
    /* -MG doesn't select the form of output and must be specified with one of


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