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]
Other format: [Raw text]

cpplib: More switch migration


More "easy" ones.  The harder ones remain.

This patch removes -h from cpplib; this option was documented but
useless as the driver doesn't pass it on (complains about an unknown
option instead).  Since it is the same as --help, and toplev.c handles
--help properly (fast exit) but not -h, I took the opportunity of
a quick kill.

It also removes -$ from gcc.c which I'd missed when removing -$ a
week or so ago.  It also undocuments the -lang- switches that cc1
accepts since they cannot be used from the driver either.

I'll apply when it finishes the checking.

Neil.

	* Makefile.in (c-opts.o): Update
	* c-opts.c: Include intl.h.
	(print_help): Move from cppinit.c.  Remove unused options.
	(COMMAND_LINE_OPTIONS): Move more from cppinit.c.
	(missing_arg): Complain for switches without an argument.
	(c_common_decode_option): Reject missing joined arguments.
	Handle new switches from cppinit.c.
	* cppinit.c (COMMAND_LINE_OPTIONS): Move some switches to c-opts.c.
	(cpp_handle_option): Similarly.
	(print_help): Moved to c-opts.c.
	* cpplib.h (struct cpp_options): Remove help_only.
	* gcc.c (cpp_unique_options): Remove -$.
	* doc/cppopts.texi: Undocument -h.

============================================================
Index: gcc/Makefile.in
--- gcc/Makefile.in	8 Aug 2002 09:10:33 -0000	1.928
+++ gcc/Makefile.in	8 Aug 2002 18:42:57 -0000
@@ -1241,7 +1241,8 @@ c-pretty-print.o : c-pretty-print.c c-pr
 	$(C_COMMON_H) $(CONFIG_H) $(SYSTEM_H) real.h
 
 c-opts.o : c-opts.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_COMMON_H) \
-        c-pragma.h flags.h toplev.h langhooks.h tree-inline.h diagnostic.h
+        c-pragma.h flags.h toplev.h langhooks.h tree-inline.h diagnostic.h \
+	intl.h
 
 # A file used by all variants of C and some other languages.
 
============================================================
Index: gcc/c-opts.c
--- gcc/c-opts.c	8 Aug 2002 06:30:12 -0000	1.2
+++ gcc/c-opts.c	8 Aug 2002 18:42:57 -0000
@@ -29,6 +29,7 @@ Software Foundation, 59 Temple Place - S
 #include "langhooks.h"
 #include "tree-inline.h"
 #include "diagnostic.h"
+#include "intl.h"
 
 static cpp_options *cpp_opts;
 
@@ -37,6 +38,7 @@ static size_t parse_option PARAMS ((cons
 static void set_Wimplicit PARAMS ((int));
 static void complain_wrong_lang PARAMS ((size_t));
 static void write_langs PARAMS ((char *, int));
+static void print_help PARAMS ((void));
 
 #define CL_C_ONLY	(1 << 0) /* Only C.  */
 #define CL_OBJC_ONLY	(1 << 1) /* Only ObjC.  */
@@ -68,15 +70,19 @@ static void write_langs PARAMS ((char *,
 
    If you request an argument with CL_JOINED, CL_SEPARATE or their
    combination CL_ARG, it is stored in the variable "arg", which is
-   guaranteed non-NULL.  It points to the argument either within the
-   argv[] vector or within one of its strings, and so the text is not
-   temporary and copies need not be made.
-
-   If you use the CL_SEPARATE flag (which is also in CL_ARG) be sure
-   to add an error message in missing_arg().  */
+   guaranteed to be non-NULL and to not be an empty string.  It points
+   to the argument either within the argv[] vector or within one of
+   that vector's strings, and so the text is permanent and copies need
+   not be made.  Be sure to add an error message in missing_arg() if
+   the default is not appropriate.  */
 
 #define COMMAND_LINE_OPTIONS						     \
+  OPT("-help",                  CL_ALL,   OPT__help)			     \
+  OPT("C",                      CL_ALL,   OPT_C)			     \
+  OPT("CC",                     CL_ALL,   OPT_CC)			     \
   OPT("E",			CL_ALL,   OPT_E)			     \
+  OPT("H",                      CL_ALL,   OPT_H)			     \
+  OPT("P",                      CL_ALL,   OPT_P)			     \
   OPT("Wall",			CL_ALL,   OPT_Wall)			     \
   OPT("Wbad-function-cast",	CL_C,     OPT_Wbad_function_cast)	     \
   OPT("Wcast-qual",		CL_ALL,   OPT_Wcast_qual)		     \
@@ -138,6 +144,7 @@ static void write_langs PARAMS ((char *,
   OPT("Wunused-macros",		CL_ALL,   OPT_Wunused_macros)		     \
   OPT("Wwrite-strings",		CL_ALL,   OPT_Wwrite_strings)		     \
   OPT("ansi",			CL_ALL,   OPT_ansi)			     \
+  OPT("d",                      CL_ALL | CL_JOINED, OPT_d)		     \
   OPT("faccess-control",	CL_CXX,   OPT_faccess_control)		     \
   OPT("fall-virtual",		CL_CXX,   OPT_fall_virtual)		     \
   OPT("falt-external-templates",CL_CXX,   OPT_falt_external_templates)	     \
@@ -191,7 +198,7 @@ static void write_langs PARAMS ((char *,
   OPT("fsquangle",		CL_CXX,   OPT_fsquangle)		     \
   OPT("fstats",			CL_CXX,   OPT_fstats)			     \
   OPT("fstrict-prototype",	CL_CXX,   OPT_fstrict_prototype)	     \
-  OPT("ftabstop=",              CL_ALL | CL_JOINED,   OPT_ftabstop)	     \
+  OPT("ftabstop=",              CL_ALL | CL_JOINED, OPT_ftabstop)	     \
   OPT("ftemplate-depth-",	CL_CXX | CL_JOINED, OPT_ftemplate_depth)     \
   OPT("fthis-is-variable",	CL_CXX,   OPT_fthis_is_variable)	     \
   OPT("funsigned-bitfields",	CL_ALL,   OPT_funsigned_bitfields)	     \
@@ -202,6 +209,8 @@ static void write_langs PARAMS ((char *,
   OPT("fweak",			CL_CXX,   OPT_fweak)			     \
   OPT("fxref",			CL_CXX,   OPT_fxref)			     \
   OPT("gen-decls",		CL_OBJC,  OPT_gen_decls)		     \
+  OPT("nostdinc",               CL_ALL,   OPT_nostdinc)			     \
+  OPT("nostdinc++",             CL_ALL,   OPT_nostdincplusplus)		     \
   OPT("pedantic",		CL_ALL,   OPT_pedantic)			     \
   OPT("pedantic-errors",	CL_ALL,   OPT_pedantic_errors)		     \
   OPT("print-objc-runtime-info", CL_OBJC, OPT_print_objc_runtime_info)	     \
@@ -217,7 +226,11 @@ static void write_langs PARAMS ((char *,
   OPT("std=iso9899:199409",	CL_C,     OPT_std_iso9899_199409)	     \
   OPT("std=iso9899:1999",	CL_C,     OPT_std_iso9899_1999)		     \
   OPT("std=iso9899:199x",	CL_C,     OPT_std_iso9899_199x)		     \
-  OPT("undef",			CL_ALL,   OPT_undef)
+  OPT("traditional-cpp",	CL_ALL,   OPT_traditional_cpp)		     \
+  OPT("trigraphs",              CL_ALL,   OPT_trigraphs)		     \
+  OPT("undef",			CL_ALL,   OPT_undef)			     \
+  OPT("v",                      CL_ALL,      OPT_v)			     \
+  OPT("w",                      CL_ALL,      OPT_w)
 
 #define OPT(text, flags, code) code,
 enum opt_code
@@ -260,6 +273,32 @@ opt_comp (p1, p2)
 }
 #endif
 
+/* Complain that switch OPT_INDEX expects an argument but none was
+   provided.  */
+static void
+missing_arg (opt_index)
+     size_t opt_index;
+{
+  switch (opt_index)
+    {
+    case OPT_Wformat_eq:
+    case OPT_d:
+    case OPT_fbuiltin_:
+    case OPT_fdump:
+    case OPT_fname_mangling:
+    case OPT_ftabstop:
+    case OPT_ftemplate_depth:
+    case OPT_std_bad:
+    default:
+      error ("missing argument to \"-%s\"", cl_options[opt_index].opt_text);
+      break;
+
+    case OPT_fconstant_string_class:
+      error ("no class name specified with -fconstant-string-class=");
+      break;
+    }
+}
+
 /* Perform a binary search to find which option the command-line INPUT
    matches.  Returns its index in the option array, and N_OPTS on
    failure.
@@ -444,20 +483,18 @@ c_common_decode_option (argc, argv)
 	  arg = argv[0] + cl_options[opt_index].opt_len + 1;
 	  if (!on)
 	    arg += strlen ("no-");
-	  if (*arg == '\0' && (option->flags & CL_SEPARATE))
-	    arg = 0;
 	}
 
-      /* If arg is still 0, we can only be a CL_SEPARATE switch.  */
-      if (arg == 0)
+      /* If we don't have an argument, and CL_SEPARATE, try the next
+	 argument in the vector.  */
+      if (!arg || (*arg == '\0' && option->flags & CL_SEPARATE))
+	arg = argv[1];
+
+      if (!arg || *arg == '\0')
 	{
-	  arg = argv[1];
-	  if (!arg)
-	    {
-	      missing_arg (opt_index);
-	      result = argc;
-	      goto done;
-	    }
+	  missing_arg (opt_index);
+	  result = argc;
+	  goto done;
 	}
     }
 
@@ -466,10 +503,31 @@ c_common_decode_option (argc, argv)
     case N_OPTS: /* Shut GCC up.  */
       break;
 
+    case OPT__help:
+      print_help ();
+      break;
+
+    case OPT_C:
+      cpp_opts->discard_comments = 0;
+      break;
+
+    case OPT_CC:
+      cpp_opts->discard_comments = 0;
+      cpp_opts->discard_comments_in_macro_exp = 0;
+      break;
+
     case OPT_E:
       flag_preprocess_only = 1;
       break;
 
+    case OPT_H:
+      cpp_opts->print_include_names = 1;
+      break;
+
+    case OPT_P:
+      cpp_opts->no_line_commands = 1;
+      break;
+
     case OPT_Wall:
       set_Wunused (on);
       set_Wformat (on);
@@ -757,6 +815,34 @@ c_common_decode_option (argc, argv)
 	warn_write_strings = on;
       break;
 
+    case OPT_d:
+      /* Args to -d specify what to dump.  Silently ignore
+	 unrecognised options; they may be aimed at toplev.c.  */
+      {
+	char c;
+
+	while ((c = *arg++) != '\0')
+	  switch (c)
+	    {
+	    case 'M':
+	      cpp_opts->dump_macros = dump_only;
+	      break;
+
+	    case 'N':
+	      cpp_opts->dump_macros = dump_names;
+	      break;
+
+	    case 'D':
+	      cpp_opts->dump_macros = dump_definitions;
+	      break;
+
+	    case 'I':
+	      cpp_opts->dump_includes = 1;
+	      break;
+	    }
+      }
+      break;
+
     case OPT_fcond_mismatch:
       if (c_language == clk_c || c_language == clk_objective_c)
 	{
@@ -877,10 +963,7 @@ c_common_decode_option (argc, argv)
       break;
 
     case OPT_fconstant_string_class:
-      if (*arg == 0)
-	error ("no class name specified with -fconstant-string-class=");
-      else
-	constant_string_class_name = arg;
+      constant_string_class_name = arg;
       break;
 
     case OPT_fdefault_inline:
@@ -980,7 +1063,6 @@ c_common_decode_option (argc, argv)
 	return 0;
 
       /* It is documented that we silently ignore silly values.  */
-      if (*arg)
 	{
 	  char *endptr;
 	  long tabstop = strtol (arg, &endptr, 10);
@@ -1009,6 +1091,17 @@ c_common_decode_option (argc, argv)
       flag_gen_declaration = 1;
       break;
 
+    case OPT_nostdinc:
+      /* No default include directories.  You must specify all
+	 include-file directories with -I.  */
+      cpp_opts->no_standard_includes = 1;
+      break;
+
+    case OPT_nostdincplusplus:
+      /* No default C++-specific include directories.  */
+      cpp_opts->no_standard_cplusplus_includes = 1;
+      break;
+
       /* We need to handle the -pedantic switches here, rather than in
 	 c_common_post_options, so that a subsequent -Wno-endif-labels
 	 is not overridden.  */
@@ -1091,9 +1184,25 @@ c_common_decode_option (argc, argv)
       flag_isoc94 = 1;
       break;
 
+    case OPT_trigraphs:
+      cpp_opts->trigraphs = 1;
+      break;
+
+    case OPT_traditional_cpp:
+      cpp_opts->traditional = 1;
+      break;
+
     case OPT_undef:
       flag_undef = 1;
       break;
+
+    case OPT_w:
+      cpp_opts->inhibit_warnings = 1;
+      break;
+
+    case OPT_v:
+      cpp_opts->verbose = 1;
+      break;
     }
 
   result = 1 + (arg == argv[1]);
@@ -1167,17 +1276,6 @@ set_Wimplicit (on)
     mesg_implicit_function_declaration = 0;
 }
 
-/* Complain that switch OPT_INDEX expects an argument but none was
-   provided.  This is currenlty unused, as the C front ends have no
-   switches that take separate arguments.  Will be used when cpplib's
-   switches are integrated.  */
-static void
-missing_arg (opt_index)
-     size_t opt_index ATTRIBUTE_UNUSED;
-{
-  abort ();
-}
-
 /* Write a slash-separated list of languages in FLAGS to BUF.  */
 static void
 write_langs (buf, flags)
@@ -1213,4 +1311,85 @@ complain_wrong_lang (opt_index)
   write_langs (bad_langs, ~ok_flags);
   warning ("\"-%s\" is valid for %s but not for %s",
 	   cl_options[opt_index].opt_text, ok_langs, bad_langs);
+}
+
+/* Handle --help output.  */
+static void
+print_help ()
+{
+  /* To keep the lines from getting too long for some compilers, limit
+     to about 500 characters (6 lines) per chunk.  */
+  fputs (_("\
+Switches:\n\
+  -include <file>           Include the contents of <file> before other files\n\
+  -imacros <file>           Accept definition of macros in <file>\n\
+  -iprefix <path>           Specify <path> as a prefix for next two options\n\
+  -iwithprefix <dir>        Add <dir> to the end of the system include path\n\
+  -iwithprefixbefore <dir>  Add <dir> to the end of the main include path\n\
+  -isystem <dir>            Add <dir> to the start of the system include path\n\
+"), stdout);
+  fputs (_("\
+  -idirafter <dir>          Add <dir> to the end of the system include path\n\
+  -I <dir>                  Add <dir> to the end of the main include path\n\
+  -I-                       Fine-grained include path control; see info docs\n\
+  -nostdinc                 Do not search system include directories\n\
+                             (dirs specified with -isystem will still be used)\n\
+  -nostdinc++               Do not search system include directories for C++\n\
+  -o <file>                 Put output into <file>\n\
+"), stdout);
+  fputs (_("\
+  -trigraphs                Support ISO C trigraphs\n\
+  -std=<std name>           Specify the conformance standard; one of:\n\
+                            gnu89, gnu99, c89, c99, iso9899:1990,\n\
+                            iso9899:199409, iso9899:1999\n\
+  -w                        Inhibit warning messages\n\
+  -W[no-]trigraphs          Warn if trigraphs are encountered\n\
+  -W[no-]comment{s}         Warn if one comment starts inside another\n\
+"), stdout);
+  fputs (_("\
+  -W[no-]traditional        Warn about features not present in traditional C\n\
+  -W[no-]undef              Warn if an undefined macro is used by #if\n\
+  -W[no-]import             Warn about the use of the #import directive\n\
+"), stdout);
+  fputs (_("\
+  -W[no-]error              Treat all warnings as errors\n\
+  -W[no-]system-headers     Do not suppress warnings from system headers\n\
+  -W[no-]all                Enable most preprocessor warnings\n\
+"), stdout);
+  fputs (_("\
+  -M                        Generate make dependencies\n\
+  -MM                       As -M, but ignore system header files\n\
+  -MD                       Generate make dependencies and compile\n\
+  -MMD                      As -MD, but ignore system header files\n\
+  -MF <file>                Write dependency output to the given file\n\
+  -MG                       Treat missing header file as generated files\n\
+"), stdout);
+  fputs (_("\
+  -MP			    Generate phony targets for all headers\n\
+  -MQ <target>              Add a MAKE-quoted target\n\
+  -MT <target>              Add an unquoted target\n\
+"), stdout);
+  fputs (_("\
+  -D<macro>                 Define a <macro> with string '1' as its value\n\
+  -D<macro>=<val>           Define a <macro> with <val> as its value\n\
+  -A<question>=<answer>     Assert the <answer> to <question>\n\
+  -A-<question>=<answer>    Disable the <answer> to <question>\n\
+  -U<macro>                 Undefine <macro> \n\
+  -v                        Display the version number\n\
+"), stdout);
+  fputs (_("\
+  -H                        Print the name of header files as they are used\n\
+  -C                        Do not discard comments\n\
+  -dM                       Display a list of macro definitions active at end\n\
+  -dD                       Preserve macro definitions in output\n\
+  -dN                       As -dD except that only the names are preserved\n\
+  -dI                       Include #include directives in the output\n\
+"), stdout);
+  fputs (_("\
+  -f[no-]preprocessed       Treat the input file as already preprocessed\n\
+  -ftabstop=<number>        Distance between tab stops for column reporting\n\
+  -P                        Do not generate #line directives\n\
+  -remap                    Remap file names when including files\n\
+  --help                    Display this information\n\
+"), stdout);
 }
============================================================
Index: gcc/cppinit.c
--- gcc/cppinit.c	8 Aug 2002 06:30:12 -0000	1.250
+++ gcc/cppinit.c	8 Aug 2002 18:42:57 -0000
@@ -87,7 +87,6 @@ struct cpp_pending
   } while (0)
 #endif
 
-static void print_help                  PARAMS ((void));
 static void path_include		PARAMS ((cpp_reader *,
 						 char *, int));
 static void init_library		PARAMS ((void));
@@ -1136,14 +1135,8 @@ new_pending_directive (pend, text, handl
 /* This is the list of all command line options, with the leading
    "-" removed.  It must be sorted in ASCII collating order.  */
 #define COMMAND_LINE_OPTIONS                                                  \
-  DEF_OPT("-help",                    0,      OPT__help)                      \
-  DEF_OPT("-target-help",             0,      OPT_target__help)               \
-  DEF_OPT("-version",                 0,      OPT__version)                   \
   DEF_OPT("A",                        no_ass, OPT_A)                          \
-  DEF_OPT("C",                        0,      OPT_C)                          \
-  DEF_OPT("CC",                       0,      OPT_CC)                         \
   DEF_OPT("D",                        no_mac, OPT_D)                          \
-  DEF_OPT("H",                        0,      OPT_H)                          \
   DEF_OPT("I",                        no_dir, OPT_I)                          \
   DEF_OPT("M",                        0,      OPT_M)                          \
   DEF_OPT("MD",                       no_fil, OPT_MD)                         \
@@ -1154,10 +1147,7 @@ new_pending_directive (pend, text, handl
   DEF_OPT("MP",                       0,      OPT_MP)                         \
   DEF_OPT("MQ",                       no_tgt, OPT_MQ)                         \
   DEF_OPT("MT",                       no_tgt, OPT_MT)                         \
-  DEF_OPT("P",                        0,      OPT_P)                          \
   DEF_OPT("U",                        no_mac, OPT_U)                          \
-  DEF_OPT("d",                        no_arg, OPT_d)                          \
-  DEF_OPT("h",                        0,      OPT_h)                          \
   DEF_OPT("idirafter",                no_dir, OPT_idirafter)                  \
   DEF_OPT("imacros",                  no_fil, OPT_imacros)                    \
   DEF_OPT("include",                  no_fil, OPT_include)                    \
@@ -1170,8 +1160,6 @@ new_pending_directive (pend, text, handl
   DEF_OPT("lang-c++",                 0,      OPT_lang_cplusplus)             \
   DEF_OPT("lang-c89",                 0,      OPT_lang_c89)                   \
   DEF_OPT("lang-objc",                0,      OPT_lang_objc)                  \
-  DEF_OPT("nostdinc",                 0,      OPT_nostdinc)                   \
-  DEF_OPT("nostdinc++",               0,      OPT_nostdincplusplus)           \
   DEF_OPT("o",                        no_fil, OPT_o)                          \
   DEF_OPT("remap",                    0,      OPT_remap)                      \
   DEF_OPT("std=c++98",                0,      OPT_std_cplusplus98)            \
@@ -1184,11 +1172,7 @@ new_pending_directive (pend, text, handl
   DEF_OPT("std=iso9899:1990",         0,      OPT_std_iso9899_1990)           \
   DEF_OPT("std=iso9899:199409",       0,      OPT_std_iso9899_199409)         \
   DEF_OPT("std=iso9899:1999",         0,      OPT_std_iso9899_1999)           \
-  DEF_OPT("std=iso9899:199x",         0,      OPT_std_iso9899_199x)           \
-  DEF_OPT("traditional-cpp",	      0,      OPT_traditional_cpp)            \
-  DEF_OPT("trigraphs",                0,      OPT_trigraphs)                  \
-  DEF_OPT("v",                        0,      OPT_v)                          \
-  DEF_OPT("w",                        0,      OPT_w)
+  DEF_OPT("std=iso9899:199x",         0,      OPT_std_iso9899_199x)
 
 #define DEF_OPT(text, msg, code) code,
 enum opt_code
@@ -1334,48 +1318,13 @@ cpp_handle_option (pfile, argc, argv)
 	{
 	case N_OPTS: /* Shut GCC up.  */
 	  break;
-	case OPT_w:
-	  CPP_OPTION (pfile, inhibit_warnings) = 1;
-	  break;
-	case OPT_h:
-	case OPT__help:
-	  print_help ();
-	  /* fall through */
-	case OPT_target__help:
-	case OPT__version:
-	  /* Nothing to do for these cases, but we need to be sure
-	     help_only is set.  */
-	  CPP_OPTION (pfile, help_only) = 1;
-	  break;
-	case OPT_v:
-	  CPP_OPTION (pfile, verbose) = 1;
-	  break;
 
-	case OPT_C:
-	  CPP_OPTION (pfile, discard_comments) = 0;
-	  break;
-	case OPT_CC:
-	  CPP_OPTION (pfile, discard_comments) = 0;
-	  CPP_OPTION (pfile, discard_comments_in_macro_exp) = 0;
-	  break;
-	case OPT_P:
-	  CPP_OPTION (pfile, no_line_commands) = 1;
-	  break;
-	case OPT_H:
-	  CPP_OPTION (pfile, print_include_names) = 1;
-	  break;
 	case OPT_D:
 	  new_pending_directive (pend, arg, cpp_define);
 	  break;
-	case OPT_trigraphs:
-	  CPP_OPTION (pfile, trigraphs) = 1;
-	  break;
 	case OPT_remap:
 	  CPP_OPTION (pfile, remap) = 1;
 	  break;
-	case OPT_traditional_cpp:
-	  CPP_OPTION (pfile, traditional) = 1;
-	  break;
 	case OPT_iprefix:
 	  CPP_OPTION (pfile, include_prefix) = arg;
 	  CPP_OPTION (pfile, include_prefix_len) = strlen (arg);
@@ -1416,15 +1365,6 @@ cpp_handle_option (pfile, argc, argv)
 	case OPT_std_c99:
 	  set_lang (pfile, CLK_STDC99);
 	  break;
-	case OPT_nostdinc:
-	  /* -nostdinc causes no default include directories.
-	     You must specify all include-file directories with -I.  */
-	  CPP_OPTION (pfile, no_standard_includes) = 1;
-	  break;
-	case OPT_nostdincplusplus:
-	  /* -nostdinc++ causes no default C++-specific include directories.  */
-	  CPP_OPTION (pfile, no_standard_cplusplus_includes) = 1;
-	  break;
 	case OPT_o:
 	  if (CPP_OPTION (pfile, out_fname) == NULL)
 	    CPP_OPTION (pfile, out_fname) = arg;
@@ -1434,31 +1374,6 @@ cpp_handle_option (pfile, argc, argv)
 	      return argc;
 	    }
 	  break;
-	case OPT_d:
-	  /* Args to -d specify what parts of macros to dump.
-	     Silently ignore unrecognised options; they may
-	     be aimed at the compiler proper.  */
-	  {
-	    char c;
-
-	    while ((c = *arg++) != '\0')
-	      switch (c)
-		{
-		case 'M':
-		  CPP_OPTION (pfile, dump_macros) = dump_only;
-		  break;
-		case 'N':
-		  CPP_OPTION (pfile, dump_macros) = dump_names;
-		  break;
-		case 'D':
-		  CPP_OPTION (pfile, dump_macros) = dump_definitions;
-		  break;
-		case 'I':
-		  CPP_OPTION (pfile, dump_includes) = 1;
-		  break;
-		}
-	  }
-	  break;
 
 	case OPT_MG:
 	  CPP_OPTION (pfile, print_deps_missing_files) = 1;
@@ -1750,104 +1665,4 @@ init_dependency_output (pfile)
     /* If -M or -MM was seen without -MF, default output to wherever
        was specified with -o.  out_fname is non-NULL here.  */
     CPP_OPTION (pfile, deps_file) = CPP_OPTION (pfile, out_fname);
-}
-
-/* Handle --help output.  */
-static void
-print_help ()
-{
-  /* To keep the lines from getting too long for some compilers, limit
-     to about 500 characters (6 lines) per chunk.  */
-  fputs (_("\
-Switches:\n\
-  -include <file>           Include the contents of <file> before other files\n\
-  -imacros <file>           Accept definition of macros in <file>\n\
-  -iprefix <path>           Specify <path> as a prefix for next two options\n\
-  -iwithprefix <dir>        Add <dir> to the end of the system include path\n\
-  -iwithprefixbefore <dir>  Add <dir> to the end of the main include path\n\
-  -isystem <dir>            Add <dir> to the start of the system include path\n\
-"), stdout);
-  fputs (_("\
-  -idirafter <dir>          Add <dir> to the end of the system include path\n\
-  -I <dir>                  Add <dir> to the end of the main include path\n\
-  -I-                       Fine-grained include path control; see info docs\n\
-  -nostdinc                 Do not search system include directories\n\
-                             (dirs specified with -isystem will still be used)\n\
-  -nostdinc++               Do not search system include directories for C++\n\
-  -o <file>                 Put output into <file>\n\
-"), stdout);
-  fputs (_("\
-  -pedantic                 Issue all warnings demanded by strict ISO C\n\
-  -pedantic-errors          Issue -pedantic warnings as errors instead\n\
-  -trigraphs                Support ISO C trigraphs\n\
-  -lang-c                   Assume that the input sources are in C\n\
-  -lang-c89                 Assume that the input sources are in C89\n\
-"), stdout);
-  fputs (_("\
-  -lang-c++                 Assume that the input sources are in C++\n\
-  -lang-objc                Assume that the input sources are in ObjectiveC\n\
-  -lang-asm                 Assume that the input sources are in assembler\n\
-"), stdout);
-  fputs (_("\
-  -std=<std name>           Specify the conformance standard; one of:\n\
-                            gnu89, gnu99, c89, c99, iso9899:1990,\n\
-                            iso9899:199409, iso9899:1999\n\
-  -w                        Inhibit warning messages\n\
-  -Wtrigraphs               Warn if trigraphs are encountered\n\
-  -Wno-trigraphs            Do not warn about trigraphs\n\
-  -Wcomment{s}              Warn if one comment starts inside another\n\
-"), stdout);
-  fputs (_("\
-  -Wno-comment{s}           Do not warn about comments\n\
-  -Wtraditional             Warn about features not present in traditional C\n\
-  -Wno-traditional          Do not warn about traditional C\n\
-  -Wundef                   Warn if an undefined macro is used by #if\n\
-  -Wno-undef                Do not warn about testing undefined macros\n\
-  -Wimport                  Warn about the use of the #import directive\n\
-"), stdout);
-  fputs (_("\
-  -Wno-import               Do not warn about the use of #import\n\
-  -Werror                   Treat all warnings as errors\n\
-  -Wno-error                Do not treat warnings as errors\n\
-  -Wsystem-headers          Do not suppress warnings from system headers\n\
-  -Wno-system-headers       Suppress warnings from system headers\n\
-  -Wall                     Enable all preprocessor warnings\n\
-"), stdout);
-  fputs (_("\
-  -M                        Generate make dependencies\n\
-  -MM                       As -M, but ignore system header files\n\
-  -MD                       Generate make dependencies and compile\n\
-  -MMD                      As -MD, but ignore system header files\n\
-  -MF <file>                Write dependency output to the given file\n\
-  -MG                       Treat missing header file as generated files\n\
-"), stdout);
-  fputs (_("\
-  -MP			    Generate phony targets for all headers\n\
-  -MQ <target>              Add a MAKE-quoted target\n\
-  -MT <target>              Add an unquoted target\n\
-"), stdout);
-  fputs (_("\
-  -D<macro>                 Define a <macro> with string '1' as its value\n\
-  -D<macro>=<val>           Define a <macro> with <val> as its value\n\
-  -A<question>=<answer>     Assert the <answer> to <question>\n\
-  -A-<question>=<answer>    Disable the <answer> to <question>\n\
-  -U<macro>                 Undefine <macro> \n\
-  -v                        Display the version number\n\
-"), stdout);
-  fputs (_("\
-  -H                        Print the name of header files as they are used\n\
-  -C                        Do not discard comments\n\
-  -dM                       Display a list of macro definitions active at end\n\
-  -dD                       Preserve macro definitions in output\n\
-  -dN                       As -dD except that only the names are preserved\n\
-  -dI                       Include #include directives in the output\n\
-"), stdout);
-  fputs (_("\
-  -fpreprocessed            Treat the input file as already preprocessed\n\
-  -ftabstop=<number>        Distance between tab stops for column reporting\n\
-  -P                        Do not generate #line directives\n\
-  -remap                    Remap file names when including files\n\
-  --version                 Display version information\n\
-  -h or --help              Display this information\n\
-"), stdout);
 }
============================================================
Index: gcc/cpplib.h
--- gcc/cpplib.h	6 Aug 2002 20:35:41 -0000	1.228
+++ gcc/cpplib.h	8 Aug 2002 18:42:58 -0000
@@ -395,11 +395,6 @@ struct cpp_options
   /* Nonzero means handle C++ alternate operator names.  */
   unsigned char operator_names;
 
-  /* True if --help, --version or --target-help appeared in the
-     options.  Stand-alone CPP should then bail out after option
-     parsing; drivers might want to continue printing help.  */
-  unsigned char help_only;
-
   /* True for traditional preprocessing.  */
   unsigned char traditional;
 
============================================================
Index: gcc/gcc.c
--- gcc/gcc.c	4 Aug 2002 16:21:01 -0000	1.334
+++ gcc/gcc.c	8 Aug 2002 18:42:59 -0000
@@ -670,7 +670,7 @@ static const char *trad_capable_cpp =
 static const char *cpp_unique_options =
 "%{C:%{!E:%eGNU C does not support -C without using -E}}\
  %{CC:%{!E:%eGNU C does not support -CC without using -E}}\
- %{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %{I*} %{P} %{$} %I\
+ %{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %{I*} %{P} %I\
  %{MD:-MD %W{!o: %b.d}%W{o*:%.d%*}}\
  %{MMD:-MMD %W{!o: %b.d}%W{o*:%.d%*}}\
  %{M} %{MM} %W{MF*} %{MG} %{MP} %{MQ*} %{MT*}\
============================================================
Index: gcc/doc/cppopts.texi
--- gcc/doc/cppopts.texi	1 Aug 2002 06:32:38 -0000	1.11
+++ gcc/doc/cppopts.texi	8 Aug 2002 18:43:00 -0000
@@ -607,10 +607,8 @@ Replacement:      [    ]    @{    @}    
 Enable special code to work around file systems which only permit very
 short file names, such as MS-DOS@.
 
-@item -h
 @itemx --help
 @itemx --target-help
-@opindex h
 @opindex help
 @opindex target-help
 Print text describing all the command line options instead of


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