This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[lto] Use nth_parm_type and num_parm_types in handle_sentinel_attribute.
- From: Kazu Hirata <kazu at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 13 Jul 2006 22:53:49 -0700
- Subject: [lto] Use nth_parm_type and num_parm_types in handle_sentinel_attribute.
Hi,
Tested on x86_64-pc-linux-gnu. Committed to the LTO branch as
obvious.
Kazu Hirata
2006-07-14 Kazu Hirata <kazu@codesourcery.com>
* c-common.c (handle_sentinel_attribute): Use nth_parm_type
and num_parm_types.
Index: c-common.c
===================================================================
--- c-common.c (revision 115307)
+++ c-common.c (working copy)
@@ -5634,7 +5634,7 @@ handle_sentinel_attribute (tree *node, t
}
else
{
- if (VOID_TYPE_P (TREE_VALUE (tree_last (params))))
+ if (VOID_TYPE_P (nth_parm_type (params, num_parm_types (params) - 1)))
{
warning (OPT_Wattributes,
"%qE attribute only applies to variadic functions", name);