aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2016-04-13 16:11:29 -0400
committerJason Merrill <jason@gcc.gnu.org>2016-04-13 16:11:29 -0400
commit2ee35bea2e5f0241fff589ddc038c9d8eb444fb9 (patch)
treef4446c9a372328e1c80530640ab77106661bfe34 /gcc/cfgexpand.c
parent5655267ca161de13e553dbfc0b7e58962fbb2443 (diff)
downloadgcc-2ee35bea2e5f0241fff589ddc038c9d8eb444fb9.zip
gcc-2ee35bea2e5f0241fff589ddc038c9d8eb444fb9.tar.gz
gcc-2ee35bea2e5f0241fff589ddc038c9d8eb444fb9.tar.bz2
Warn about empty parameter ABI with -Wabi=9.
* call.c (empty_class_msg, mark_for_abi_warning) (warn_empty_class_abi): New. (build_call_a): Use them. * decl.c (store_parm_decls): Use mark_for_abi_warning. * error.c (pp_format_to_string): New. From-SVN: r234960
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r--gcc/cfgexpand.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 1341c14..4a5cf16 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -73,6 +73,7 @@ along with GCC; see the file COPYING3. If not see
#include "builtins.h"
#include "tree-chkp.h"
#include "rtl-chkp.h"
+#include "langhooks.h"
/* Some systems use __main in a way incompatible with its use in gcc, in these
cases use the macros NAME__MAIN to give a quoted symbol and SYMBOL__MAIN to
@@ -6221,6 +6222,15 @@ pass_expand::execute (function *fun)
(int) PARAM_VALUE (PARAM_SSP_BUFFER_SIZE));
}
+ if (warn_abi)
+ if (tree attr = lookup_attribute ("abi warning",
+ DECL_ATTRIBUTES (current_function_decl)))
+ warning_at (DECL_SOURCE_LOCATION (current_function_decl),
+ OPT_Wabi, "definition of %qs: %s",
+ identifier_to_locale (lang_hooks.decl_printable_name
+ (current_function_decl, 1)),
+ TREE_STRING_POINTER (TREE_VALUE (TREE_VALUE (attr))));
+
/* Set up parameters and prepare for return, for the function. */
expand_function_start (current_function_decl);