summaryrefslogtreecommitdiffstats
path: root/gcc/cppinit.c
diff options
context:
space:
mode:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2000-03-16 14:15:17 +0000
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2000-03-16 14:15:17 +0000
commit77ee202d72d4a24b6ff5b159ebf0bbb3822c247e (patch)
tree9a081f508fa06313ce5b328de9f83aa0d9ab98d9 /gcc/cppinit.c
parent562401baab2910f7eb688c128264744f1df88d66 (diff)
downloadppe42-gcc-77ee202d72d4a24b6ff5b159ebf0bbb3822c247e.tar.gz
ppe42-gcc-77ee202d72d4a24b6ff5b159ebf0bbb3822c247e.zip
2000-03-16 Neil Booth <NeilB@earthling.net>
* cppinit.c (handle_option): Implement #unassert directive as -A- command line option. (print_help): Update. * cpptexi.c: Update. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32584 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cppinit.c')
-rw-r--r--gcc/cppinit.c42
1 files changed, 26 insertions, 16 deletions
diff --git a/gcc/cppinit.c b/gcc/cppinit.c
index 674e140db09..419257308a4 100644
--- a/gcc/cppinit.c
+++ b/gcc/cppinit.c
@@ -1493,26 +1493,35 @@ handle_option (pfile, argc, argv)
opts->no_output = 1;
break;
case OPT_A:
- if (strcmp (arg, "-"))
- new_pending_directive (opts, arg, cpp_assert);
- else
+ if (arg[0] == '-')
{
- /* -A- eliminates all predefined macros and assertions.
- Let's include also any that were specified earlier
- on the command line. That way we can get rid of any
- that were passed automatically in from GCC. */
- struct pending_option *o1, *o2;
-
- o1 = opts->pending->directive_head;
- while (o1)
+ /* -A with an argument beginning with '-' acts as
+ #unassert on whatever immediately follows the '-'.
+ If "-" is the whole argument, we eliminate all
+ predefined macros and assertions, including those
+ that were specified earlier on the command line.
+ That way we can get rid of any that were passed
+ automatically in from GCC. */
+
+ if (arg[1] == '\0')
{
- o2 = o1->next;
- free (o1);
- o1 = o2;
+ struct pending_option *o1, *o2;
+
+ o1 = opts->pending->directive_head;
+ while (o1)
+ {
+ o2 = o1->next;
+ free (o1);
+ o1 = o2;
+ }
+ opts->pending->directive_head = NULL;
+ opts->pending->directive_tail = NULL;
}
- opts->pending->directive_head = NULL;
- opts->pending->directive_tail = NULL;
+ else
+ new_pending_directive (opts, arg + 1, cpp_unassert);
}
+ else
+ new_pending_directive (opts, arg, cpp_assert);
break;
case OPT_U:
new_pending_directive (opts, arg, cpp_undef);
@@ -1750,6 +1759,7 @@ Switches:\n\
-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\
-H Print the name of header files as they are used\n\
OpenPOWER on IntegriCloud