summaryrefslogtreecommitdiff
path: root/gcc/diagnostic.c
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2002-01-12 14:05:32 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2002-01-12 14:05:32 +0000
commit76ab50f8c432c2bd5c347c2f7fd63b8fce30a494 (patch)
tree78bd460be80a3f429232e5c5858492b59c3012f7 /gcc/diagnostic.c
parentebd87ade56e85aef65bc267915f58abc5a32c015 (diff)
downloadgcc-76ab50f8c432c2bd5c347c2f7fd63b8fce30a494.tar.gz
* diagnostic.c (warn_deprecated_use): Rework to lower indentation.
* expr.c (emit_move_insn_1): Remove warning, use HOST_WIDE_INT for offsets, and change line folding. * optabs.c (expand_binop): Remove warnings. * sdbout.c (sdbout_record_type_name): Constify NAME to avoid warning. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@48801 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/diagnostic.c')
-rw-r--r--gcc/diagnostic.c61
1 files changed, 28 insertions, 33 deletions
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index 7633523b088..2803049cf04 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -1525,41 +1525,36 @@ void
warn_deprecated_use (node)
tree node;
{
- if (node && warn_deprecated_decl)
+ if (node == 0 || !warn_deprecated_decl)
+ return;
+
+ if (DECL_P (node))
+ warning ("`%s' is deprecated (declared at %s:%d)",
+ IDENTIFIER_POINTER (DECL_NAME (node)),
+ DECL_SOURCE_FILE (node), DECL_SOURCE_LINE (node));
+ else if (TYPE_P (node))
{
- if (DECL_P (node))
- {
- warning ("`%s' is deprecated (declared at %s:%d)",
- IDENTIFIER_POINTER (DECL_NAME (node)),
- DECL_SOURCE_FILE (node), DECL_SOURCE_LINE (node));
- }
- else if (TYPE_P (node))
- {
- const char *what = NULL;
- tree decl = TYPE_STUB_DECL (node);
-
- if (TREE_CODE (TYPE_NAME (node)) == IDENTIFIER_NODE)
- what = IDENTIFIER_POINTER (TYPE_NAME (node));
- else if (TREE_CODE (TYPE_NAME (node)) == TYPE_DECL
- && DECL_NAME (TYPE_NAME (node)))
- what = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (node)));
+ const char *what = NULL;
+ tree decl = TYPE_STUB_DECL (node);
+
+ if (TREE_CODE (TYPE_NAME (node)) == IDENTIFIER_NODE)
+ what = IDENTIFIER_POINTER (TYPE_NAME (node));
+ else if (TREE_CODE (TYPE_NAME (node)) == TYPE_DECL
+ && DECL_NAME (TYPE_NAME (node)))
+ what = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (node)));
- if (what)
- {
- if (decl)
- warning ("`%s' is deprecated (declared at %s:%d)", what,
- DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl));
- else
- warning ("`%s' is deprecated", what);
- }
+ if (what)
+ {
+ if (decl)
+ warning ("`%s' is deprecated (declared at %s:%d)", what,
+ DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl));
else
- {
- if (decl)
- warning ("type is deprecated (declared at %s:%d)",
- DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl));
- else
- warning ("type is deprecated");
- }
- }
+ warning ("`%s' is deprecated", what);
+ }
+ else if (decl)
+ warning ("type is deprecated (declared at %s:%d)",
+ DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl));
+ else
+ warning ("type is deprecated");
}
}