c-opts.c (CL_REJECT_NEGATIVE): New.
* c-opts.c (CL_REJECT_NEGATIVE): New. (c_common_decode_option): Update to use it. * c.opt: Update documentation; use RejectNegative. * opts.sh: Handle RejectNegative. From-SVN: r67325
This commit is contained in:
parent
d48b7f2a3f
commit
c83857ff28
4 changed files with 32 additions and 22 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2003-06-02 Neil Booth <neil@daikokuya.co.uk>
|
||||||
|
|
||||||
|
* c-opts.c (CL_REJECT_NEGATIVE): New.
|
||||||
|
(c_common_decode_option): Update to use it.
|
||||||
|
* c.opt: Update documentation; use RejectNegative.
|
||||||
|
* opts.sh: Handle RejectNegative.
|
||||||
|
|
||||||
2003-06-01 Zack Weinberg <zack@codesourcery.com>
|
2003-06-01 Zack Weinberg <zack@codesourcery.com>
|
||||||
|
|
||||||
* ggc-page.c (init_ggc): Give better diagnostics on failure to
|
* ggc-page.c (init_ggc): Give better diagnostics on failure to
|
||||||
|
|
32
gcc/c-opts.c
32
gcc/c-opts.c
|
@ -119,12 +119,13 @@ static void finish_options PARAMS ((void));
|
||||||
#define STDC_0_IN_SYSTEM_HEADERS 0
|
#define STDC_0_IN_SYSTEM_HEADERS 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define CL_C (1 << 0) /* Only C. */
|
#define CL_C (1 << 0) /* Only C. */
|
||||||
#define CL_OBJC (1 << 1) /* Only ObjC. */
|
#define CL_OBJC (1 << 1) /* Only ObjC. */
|
||||||
#define CL_CXX (1 << 2) /* Only C++. */
|
#define CL_CXX (1 << 2) /* Only C++. */
|
||||||
#define CL_OBJCXX (1 << 3) /* Only ObjC++. */
|
#define CL_OBJCXX (1 << 3) /* Only ObjC++. */
|
||||||
#define CL_JOINED (1 << 4) /* If takes joined argument. */
|
#define CL_JOINED (1 << 4) /* If takes joined argument. */
|
||||||
#define CL_SEPARATE (1 << 5) /* If takes a separate argument. */
|
#define CL_SEPARATE (1 << 5) /* If takes a separate argument. */
|
||||||
|
#define CL_REJECT_NEGATIVE (1 << 6) /* Reject no- form. */
|
||||||
|
|
||||||
#include "c-options.c"
|
#include "c-options.c"
|
||||||
|
|
||||||
|
@ -398,9 +399,15 @@ c_common_decode_option (argc, argv)
|
||||||
if (opt_index == N_OPTS)
|
if (opt_index == N_OPTS)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
result = 1;
|
|
||||||
option = &cl_options[opt_index];
|
option = &cl_options[opt_index];
|
||||||
|
|
||||||
|
/* Reject negative form of switches that don't take negatives. */
|
||||||
|
if (!on && (option->flags & CL_REJECT_NEGATIVE))
|
||||||
|
goto done;
|
||||||
|
|
||||||
|
/* We've recognised this switch. */
|
||||||
|
result = 1;
|
||||||
|
|
||||||
/* Sort out any argument the switch takes. */
|
/* Sort out any argument the switch takes. */
|
||||||
if (option->flags & (CL_JOINED | CL_SEPARATE))
|
if (option->flags & (CL_JOINED | CL_SEPARATE))
|
||||||
{
|
{
|
||||||
|
@ -629,10 +636,7 @@ c_common_decode_option (argc, argv)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OPT_Werror_implicit_function_declaration:
|
case OPT_Werror_implicit_function_declaration:
|
||||||
if (!on)
|
mesg_implicit_function_declaration = 2;
|
||||||
result = 0;
|
|
||||||
else
|
|
||||||
mesg_implicit_function_declaration = 2;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OPT_Wfloat_equal:
|
case OPT_Wfloat_equal:
|
||||||
|
@ -908,7 +912,7 @@ c_common_decode_option (argc, argv)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OPT_fdump_:
|
case OPT_fdump_:
|
||||||
if (!on || !dump_switch_p (argv[0] + strlen ("-f")))
|
if (!dump_switch_p (argv[0] + strlen ("-f")))
|
||||||
result = 0;
|
result = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1072,10 +1076,6 @@ c_common_decode_option (argc, argv)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OPT_ftabstop_:
|
case OPT_ftabstop_:
|
||||||
/* Don't recognize -fno-tabstop=. */
|
|
||||||
if (!on)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
/* It is documented that we silently ignore silly values. */
|
/* It is documented that we silently ignore silly values. */
|
||||||
{
|
{
|
||||||
char *endptr;
|
char *endptr;
|
||||||
|
|
10
gcc/c.opt
10
gcc/c.opt
|
@ -24,7 +24,9 @@
|
||||||
; and each field appearing on its own line. The first field is the
|
; and each field appearing on its own line. The first field is the
|
||||||
; command-line switch with the leading "-" removed. All options
|
; command-line switch with the leading "-" removed. All options
|
||||||
; beginning with "f" or "W" are implicitly assumed to take a "no-"
|
; beginning with "f" or "W" are implicitly assumed to take a "no-"
|
||||||
; form; this form should not be listed.
|
; form; this form should not be listed. If you do not want this
|
||||||
|
; negative form and you want it to be automatically rejected, add
|
||||||
|
; RejectNegative to the second field.
|
||||||
|
|
||||||
; The second field is a space-separated list of which parts of the
|
; The second field is a space-separated list of which parts of the
|
||||||
; compiler recognize the switch. Current valid entries are "C",
|
; compiler recognize the switch. Current valid entries are "C",
|
||||||
|
@ -144,7 +146,7 @@ Werror
|
||||||
C ObjC C++ ObjC++
|
C ObjC C++ ObjC++
|
||||||
|
|
||||||
Werror-implicit-function-declaration
|
Werror-implicit-function-declaration
|
||||||
C ObjC
|
C ObjC RejectNegative
|
||||||
|
|
||||||
Wfloat-equal
|
Wfloat-equal
|
||||||
C ObjC C++ ObjC++
|
C ObjC C++ ObjC++
|
||||||
|
@ -339,7 +341,7 @@ fdollars-in-identifiers
|
||||||
C ObjC C++ ObjC++
|
C ObjC C++ ObjC++
|
||||||
|
|
||||||
fdump-
|
fdump-
|
||||||
C ObjC C++ ObjC++ Joined
|
C ObjC C++ ObjC++ Joined RejectNegative
|
||||||
|
|
||||||
felide-constructors
|
felide-constructors
|
||||||
C++ ObjC++
|
C++ ObjC++
|
||||||
|
@ -465,7 +467,7 @@ fstrict-prototype
|
||||||
C++ ObjC++
|
C++ ObjC++
|
||||||
|
|
||||||
ftabstop=
|
ftabstop=
|
||||||
C ObjC C++ ObjC++ Joined
|
C ObjC C++ ObjC++ Joined RejectNegative
|
||||||
|
|
||||||
ftemplate-depth-
|
ftemplate-depth-
|
||||||
C++ ObjC++ Joined
|
C++ ObjC++ Joined
|
||||||
|
|
|
@ -48,8 +48,9 @@ cat "$@" | ${AWK} '
|
||||||
if (langs ~ ":ObjC:") flags = flags " | CL_OBJC"
|
if (langs ~ ":ObjC:") flags = flags " | CL_OBJC"
|
||||||
if (langs ~ ":C\\+\\+:") flags = flags " | CL_CXX"
|
if (langs ~ ":C\\+\\+:") flags = flags " | CL_CXX"
|
||||||
if (langs ~ ":ObjC\\+\\+:") flags = flags " | CL_OBJCXX"
|
if (langs ~ ":ObjC\\+\\+:") flags = flags " | CL_OBJCXX"
|
||||||
if (langs ~ ":Joined") flags = flags " | CL_JOINED"
|
if (langs ~ ":Joined:") flags = flags " | CL_JOINED"
|
||||||
if (langs ~ ":Separate") flags = flags " | CL_SEPARATE"
|
if (langs ~ ":Separate:") flags = flags " | CL_SEPARATE"
|
||||||
|
if (langs ~ ":RejectNegative:") flags = flags " | CL_REJECT_NEGATIVE"
|
||||||
sub( "^0 \\| ", "", flags )
|
sub( "^0 \\| ", "", flags )
|
||||||
return flags
|
return flags
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue