From: Neil Booth Date: Tue, 15 Jul 2003 05:48:16 +0000 (+0000) Subject: c-opts.c (print_help): Remove. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=72de27eaff3d77f5c386bef917a77261ab98f4ec;p=gcc.git c-opts.c (print_help): Remove. * c-opts.c (print_help): Remove. (c_common_handle_option): Don't handle --help. * c.opt: Document some options. (--help): Remove. * opts.c (print_filtered_help): New. (print_help): Use it. From-SVN: r69383 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d4a576014fe..0b94a6e1b86 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2003-07-15 Neil Booth + + * c-opts.c (print_help): Remove. + (c_common_handle_option): Don't handle --help. + * c.opt: Document some options. + (--help): Remove. + * opts.c (print_filtered_help): New. + (print_help): Use it. + 2003-07-14 Geoffrey Keating * c-common.c (c_common_type_for_mode): Handle V4DFmode. diff --git a/gcc/c-opts.c b/gcc/c-opts.c index 5bc88f92d28..3925c445d68 100644 --- a/gcc/c-opts.c +++ b/gcc/c-opts.c @@ -99,7 +99,6 @@ static size_t include_cursor; static bool permit_fortran_options; static void set_Wimplicit (int); -static void print_help (void); static void handle_OPT_d (const char *); static void set_std_cxx98 (int); static void set_std_c89 (int, int); @@ -255,10 +254,6 @@ c_common_handle_option (size_t scode, const char *arg, int value) result = permit_fortran_options; break; - case OPT__help: - print_help (); - break; - case OPT__output_pch_: pch_file = arg; break; @@ -1538,91 +1533,3 @@ handle_OPT_d (const char *arg) break; } } - -/* Handle --help output. */ -static void -print_help (void) -{ - /* To keep the lines from getting too long for some compilers, limit - to about 500 characters (6 lines) per chunk. */ - fputs (_("\ -Switches:\n\ - -include Include the contents of before other files\n\ - -imacros Accept definition of macros in \n\ - -iprefix Specify as a prefix for next two options\n\ - -iwithprefix Add to the end of the system include path\n\ - -iwithprefixbefore Add to the end of the main include path\n\ - -isystem Add to the start of the system include path\n\ -"), stdout); - fputs (_("\ - -idirafter Add to the end of the system include path\n\ - -I Add 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 Put output into \n\ -"), stdout); - fputs (_("\ - -trigraphs Support ISO C trigraphs\n\ - -std= Specify the conformance standard; one of:\n\ - gnu89, gnu99, c89, c99, iso9899:1990,\n\ - iso9899:199409, iso9899:1999, c++98\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 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 Add a MAKE-quoted target\n\ - -MT Add an unquoted target\n\ -"), stdout); - fputs (_("\ - -D Define a with string '1' as its value\n\ - -D= Define a with as its value\n\ - -A= Assert the to \n\ - -A-= Disable the to \n\ - -U Undefine \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= Distance between tab stops for column reporting\n\ - -ftarget-charset= Convert all strings and character constants\n\ - to character set \n\ - -ftarget-wide-charset= Convert all wide strings and character constants\n\ - to character set \n\ -"), stdout); - fputs (_("\ - -isysroot Set to be the system root directory\n\ - -P Do not generate #line directives\n\ - -remap Remap file names when including files\n\ - --help Display this information\n\ -"), stdout); -} diff --git a/gcc/c.opt b/gcc/c.opt index 64e9fe02ddd..ca0c1d81721 100644 --- a/gcc/c.opt +++ b/gcc/c.opt @@ -67,71 +67,86 @@ C++ Language ObjC++ --help -C ObjC C++ ObjC++ - -output-pch= C ObjC C++ ObjC++ Joined Separate A C ObjC C++ ObjC++ Joined Separate +-A= Assert the to . Putting '-' before disables the to C C ObjC C++ ObjC++ +Do not discard comments CC C ObjC C++ ObjC++ +Do not discard comments in macro expansions D C ObjC C++ ObjC++ Joined Separate +-D[=] Define a with as its value. If just is given, is taken to be 1 E C ObjC C++ ObjC++ H C ObjC C++ ObjC++ +Print the name of header files as they are used I C ObjC C++ ObjC++ Joined Separate +-I Add to the end of the main include path. -I- gives more include path control; see info documentation M C ObjC C++ ObjC++ +Generate make dependencies MD C ObjC C++ ObjC++ Separate +Generate make dependencies and compile MF C ObjC C++ ObjC++ Joined Separate +-MF Write dependency output to the given file MG C ObjC C++ ObjC++ +Treat missing header files as generated files MM C ObjC C++ ObjC++ +Like -M but ignore system header files MMD C ObjC C++ ObjC++ Separate +Like -MD but ignore system header files MP C ObjC C++ ObjC++ +Generate phony targets for all headers MQ C ObjC C++ ObjC++ Joined Separate +-MQ Add a MAKE-quoted target MT C ObjC C++ ObjC++ Joined Separate +-MT Add an unquoted target P C ObjC C++ ObjC++ +Do not generate #line directives U C ObjC C++ ObjC++ Joined Separate +-U Undefine Wabi C++ ObjC++ Wall C ObjC C++ ObjC++ +Enable most preprocessor warnings Wbad-function-cast C ObjC @@ -144,9 +159,11 @@ C ObjC C++ ObjC++ Wcomment C ObjC C++ ObjC++ +Warn about possibly nested block comments, and C++ comments spanning more than one physical line Wcomments C ObjC C++ ObjC++ +Synonym for -Wcomment Wconversion C ObjC C++ ObjC++ @@ -165,9 +182,11 @@ C++ ObjC++ Wendif-labels C ObjC C++ ObjC++ +Warn about stray tokens after #elif and #endif Werror C ObjC C++ ObjC++ +; Documented in common.opt Werror-implicit-function-declaration C ObjC RejectNegative @@ -207,6 +226,7 @@ C ObjC Wimport C ObjC C++ ObjC++ +Warn about uses of the #import directive Winvalid-offsetof C++ ObjC++ @@ -294,24 +314,29 @@ C++ ObjC++ Wsystem-headers C ObjC C++ ObjC++ +Do not suppress warnings from system headers Wtraditional C ObjC +Warn about features not present in traditional C Wtrigraphs C ObjC C++ ObjC++ +Warn if trigraphs are encountered that might affect the meaning of the program Wundeclared-selector ObjC ObjC++ Wundef C ObjC C++ ObjC++ +Warn if an undefined macro is used in an #if directive Wunknown-pragmas C ObjC C++ ObjC++ Wunused-macros C ObjC C++ ObjC++ +Warn about macros defined in the main file that are not used Wwrite-strings C ObjC C++ ObjC++ @@ -321,6 +346,7 @@ C ObjC C++ ObjC++ d C ObjC C++ ObjC++ Joined +; Documented in common.opt. FIXME - what about -dI, -dD, -dN and -dD? fabi-version= C++ ObjC++ Joined UInteger @@ -363,6 +389,7 @@ C++ ObjC++ fdollars-in-identifiers C ObjC C++ ObjC++ +Permit '$' as an identifier character fdump- C ObjC C++ ObjC++ Joined RejectNegative @@ -378,6 +405,7 @@ C++ ObjC++ fexec-charset= C ObjC C++ ObjC++ Joined RejectNegative +-fexec-charset= Convert all strings and character constants to character set fexternal-templates C++ ObjC++ @@ -459,6 +487,7 @@ C++ ObjC++ fpreprocessed C ObjC C++ ObjC++ +Treat the input file as already preprocessed frepo C++ ObjC++ @@ -495,6 +524,7 @@ C++ ObjC++ ftabstop= C ObjC C++ ObjC++ Joined RejectNegative UInteger +-ftabstop= Distance between tab stops for column reporting ftemplate-depth- C++ ObjC++ Joined RejectNegative UInteger @@ -522,6 +552,7 @@ C++ ObjC++ fwide-exec-charset= C ObjC C++ ObjC++ Joined RejectNegative +-fwide-exec-charset= Convert all wide strings and character constants to character set fxref C++ ObjC++ @@ -531,104 +562,137 @@ ObjC ObjC++ idirafter C ObjC C++ ObjC++ Joined Separate +-idirafter Add to the end of the system include path imacros C ObjC C++ ObjC++ Joined Separate +-imacros Accept definition of macros in include C ObjC C++ ObjC++ Joined Separate +-include Include the contents of before other files iprefix C ObjC C++ ObjC++ Joined Separate +-iprefix Specify as a prefix for next two options isysroot C ObjC C++ ObjC++ Joined Separate +-isysroot Set to be the system root directory isystem C ObjC C++ ObjC++ Joined Separate +-isystem Add to the start of the system include path iwithprefix C ObjC C++ ObjC++ Joined Separate +-iwithprefix Add to the end of the system include path iwithprefixbefore C ObjC C++ ObjC++ Joined Separate +-iwithprefixbefore Add to the end of the main include path lang-asm C +For internal use only lang-objc C ObjC C++ ObjC++ +For internal use only nostdinc C ObjC C++ ObjC++ +Do not search standard system include directories (those specified with -isystem will still be used) nostdinc++ -C ObjC C++ ObjC++ +C++ ObjC++ +Do not search standard system include directories for C++ o C ObjC C++ ObjC++ Joined Separate +; Documented in common.opt pedantic C ObjC C++ ObjC++ +; Documented in common.opt pedantic-errors C ObjC C++ ObjC++ +; Documented in common.opt print-objc-runtime-info ObjC ObjC++ remap C ObjC C++ ObjC++ +Remap file names when including files std=c++98 C++ ObjC++ +Conform to the ISO 1998 C++ standard std=c89 C ObjC +Conform to the ISO 1990 C standard std=c99 C ObjC +Conform to the ISO 1999 C standard std=c9x C ObjC +Deprecated in favor of -std=c99 std=gnu++98 C++ ObjC++ +Conform to the ISO 1998 C++ standard with GNU extensions std=gnu89 C ObjC +Conform to the ISO 1990 C standard with GNU extensions std=gnu99 C ObjC +Conform to the ISO 1999 C standard with GNU extensions std=gnu9x C ObjC +Deprecated in favor of -std=gnu99 std=iso9899:1990 C ObjC +Deprecated in favor of -std=c89 std=iso9899:199409 C ObjC +Conform to the ISO 1990 C standard as amended in 1994 std=iso9899:1999 C ObjC +Deprecated in favor of -std=c99 std=iso9899:199x C ObjC +Deprecated in favor of -std=c99 traditional-cpp C ObjC C++ ObjC++ +Enable traditional preprocessing trigraphs C ObjC C++ ObjC++ +-trigraphs Support ISO C trigraphs undef C ObjC C++ ObjC++ +Do not predefine system-specific and GCC-specific macros v C ObjC C++ ObjC++ +Enable verbose output w C ObjC C++ ObjC++ +; Documented in common.opt ; This comment is to ensure we retain the blank line above. diff --git a/gcc/opts.c b/gcc/opts.c index 64f5ec6cda3..7a203dcc2ec 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -139,6 +139,7 @@ static void complain_wrong_lang (const char *, const struct cl_option *, static void handle_options (unsigned int, const char **, unsigned int); static void wrap_help (const char *help, const char *item, int item_width); static void print_help (void); +static void print_filtered_help (unsigned int flag); /* Perform a binary search to find which option the command-line INPUT matches. Returns its index in the option array, and N_OPTS @@ -1484,17 +1485,46 @@ fast_math_flags_set_p (void) /* Output --help text. */ static void print_help (void) +{ + size_t i; + + puts (_("The following options are language-independent:\n")); + + print_filtered_help (CL_COMMON); + + for (i = 0; lang_names[i]; i++) + { + printf (_("\nThe %s front end recognizes the following options:\n"), + lang_names[i]); + print_filtered_help (1U << i); + } + + puts ( "\n" ); + display_help (); +} + +/* Print help for a specific front-end, etc. */ +static void +print_filtered_help (unsigned int flag) { size_t i, len; + unsigned int filter; - puts (_("\nThe following options are language-independent:\n")); + /* Don't print COMMON options twice. */ + filter = flag; + if (flag != CL_COMMON) + filter |= CL_COMMON; for (i = 0; i < cl_options_count; i++) { - const char *help = cl_options[i].help; + const char *help; const char *opt, *tab; + if ((cl_options[i].flags & filter) != flag) + continue; + /* During transition, ignore switches with no help. */ + help = cl_options[i].help; if (!help) continue; @@ -1516,9 +1546,6 @@ print_help (void) wrap_help (help, opt, len); } - - puts ( "\n" ); - display_help (); } /* Output ITEM, of length ITEM_WIDTH, in the left column, followed by