aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2003-06-12 16:02:41 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2003-06-12 16:02:41 +0200
commitc47d8f8255dca648195a83f5bd768e443f3a3976 (patch)
treed1e34bb621b6b07756b71b0e08062bb4a23713d5
parent109480b1c5e848f7411da6caad8dad560e66d13a (diff)
downloadgcc-c47d8f8255dca648195a83f5bd768e443f3a3976.zip
gcc-c47d8f8255dca648195a83f5bd768e443f3a3976.tar.gz
gcc-c47d8f8255dca648195a83f5bd768e443f3a3976.tar.bz2
c-opts.c (complain_wrong_lang): Add on argument.
* c-opts.c (complain_wrong_lang): Add on argument. Print no- switch if on is false. (c_common_decode_option): Adjust caller. From-SVN: r67831
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/c-opts.c12
2 files changed, 13 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ece54b6..bd4e118 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2003-06-12 Jakub Jelinek <jakub@redhat.com>
+
+ * c-opts.c (complain_wrong_lang): Add on argument.
+ Print no- switch if on is false.
+ (c_common_decode_option): Adjust caller.
+
2003-06-12 Ulrich Weigand <uweigand@de.ibm.com>
* config/s390/s390.c (s390_emit_prologue): Use LA instead of AR
diff --git a/gcc/c-opts.c b/gcc/c-opts.c
index 6f449a0..2088486 100644
--- a/gcc/c-opts.c
+++ b/gcc/c-opts.c
@@ -102,7 +102,7 @@ static size_t include_cursor;
static void missing_arg PARAMS ((enum opt_code));
static void set_Wimplicit PARAMS ((int));
-static void complain_wrong_lang PARAMS ((size_t));
+static void complain_wrong_lang PARAMS ((size_t, int));
static void write_langs PARAMS ((char *, int));
static void print_help PARAMS ((void));
static void handle_OPT_d PARAMS ((const char *));
@@ -265,7 +265,7 @@ c_common_handle_option (size_t scode, const char *arg, int on)
lang_mask = lang_flags[(c_language << 1) + flag_objc];
if (!(option->flags & lang_mask))
{
- complain_wrong_lang (code);
+ complain_wrong_lang (code, on);
return 1;
}
@@ -1553,8 +1553,9 @@ write_langs (buf, flags)
/* Complain that switch OPT_INDEX does not apply to this front end. */
static void
-complain_wrong_lang (opt_index)
+complain_wrong_lang (opt_index, on)
size_t opt_index;
+ int on;
{
char ok_langs[60], bad_langs[60];
int ok_flags = cl_options[opt_index].flags;
@@ -1562,8 +1563,9 @@ complain_wrong_lang (opt_index)
write_langs (ok_langs, ok_flags);
write_langs (bad_langs, ~ok_flags);
/* Eventually this should become a hard error. */
- warning ("\"-%s\" is valid for %s but not for %s",
- cl_options[opt_index].opt_text, ok_langs, bad_langs);
+ warning ("\"-%c%s%s\" is valid for %s but not for %s",
+ cl_options[opt_index].opt_text[0], on ? "" : "no-",
+ cl_options[opt_index].opt_text + 1, ok_langs, bad_langs);
}
/* Handle --help output. */