diff options
author | Joseph Myers <joseph@codesourcery.com> | 2005-05-02 20:39:04 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2005-05-02 20:39:04 +0100 |
commit | 6fb58bba49ae8e0afaf502975e6fa30cbc288ed0 (patch) | |
tree | d9cc9fb4c89fa7f24c4b6b67239e8a3bb79274eb /gcc/c-tree.h | |
parent | 806aa9014b8ce5c3d896ff8cde6ef5021bd73043 (diff) | |
download | gcc-6fb58bba49ae8e0afaf502975e6fa30cbc288ed0.zip gcc-6fb58bba49ae8e0afaf502975e6fa30cbc288ed0.tar.gz gcc-6fb58bba49ae8e0afaf502975e6fa30cbc288ed0.tar.bz2 |
re PR c/15698 (no error in presence of broken builtin fn + K&R declaration)
PR c/15698
* c-tree.h (C_DECL_BUILTIN_PROTOTYPE): New.
* c-decl.c (current_function_prototype_built_in,
current_function_prototype_arg_types): New.
(merge_decls): Keep source location of prototype followed by
nonprototype declaration. Update C_DECL_BUILTIN_PROTOTYPE.
(builtin_function): Set C_DECL_BUILTIN_PROTOTYPE.
(start_function): Always set current_function_prototype_locus,
current_function_prototype_built_in and
current_function_prototype_arg_types. Check for external
prototype whether or not visible for external function and set
current_function_prototype_arg_types accordingly.
(store_parm_decls_oldstyle): Use
current_function_prototype_arg_types for checking old-style
definition against prototype. Give warnings only if
current_function_prototype_built_in).
testsuite:
* gcc.dg/builtins-30.c: Update expected messages.
* gcc.dg/pr15698-1.c, gcc.dg/pr15698-2.c, gcc.dg/pr15698-3.c,
gcc.dg/pr15698-4.c, gcc.dg/pr15698-5.c, gcc.dg/pr15698-6.c,
gcc.dg/pr15698-7.c, pr15698-8.c: New tests.
From-SVN: r99118
Diffstat (limited to 'gcc/c-tree.h')
-rw-r--r-- | gcc/c-tree.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/c-tree.h b/gcc/c-tree.h index c7cbd13..c22ae8a 100644 --- a/gcc/c-tree.h +++ b/gcc/c-tree.h @@ -89,6 +89,11 @@ struct lang_type GTY(()) #define C_DECL_DECLARED_BUILTIN(EXP) \ DECL_LANG_FLAG_3 (FUNCTION_DECL_CHECK (EXP)) +/* For FUNCTION_DECLs, evaluates true if the decl is built-in, has a + built-in prototype and does not have a non-built-in prototype. */ +#define C_DECL_BUILTIN_PROTOTYPE(EXP) \ + DECL_LANG_FLAG_6 (FUNCTION_DECL_CHECK (EXP)) + /* Record whether a decl was declared register. This is strictly a front-end flag, whereas DECL_REGISTER is used for code generation; they may differ for structures with volatile fields. */ |