diff options
author | manu <manu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-10-22 16:33:17 +0000 |
---|---|---|
committer | manu <manu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-10-22 16:33:17 +0000 |
commit | bd8a0c52476a22ec39251b169a15c0161e32893b (patch) | |
tree | 02faddfaf2899520e26249176f8c487a14c6b89b /gcc/c-typeck.c | |
parent | a5196aaeefd472abec700261f6ba194ce9deb889 (diff) | |
download | gcc-bd8a0c52476a22ec39251b169a15c0161e32893b.tar.gz |
2008-10-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/30949
* c-typeck.c (convert_for_assignment): Do not give declaration's
location for builtins. Spell out which type was expected and which
was given.
testsuite/
* gcc.target/i386/sse-vect-types.c: Update.
* gcc.dg/simd-5.c: Update.
* gcc.dg/assign-warn-2.c: Update.
* gcc.dg/simd-2.c: Update.
* gcc.dg/simd-6.c: Update.
* gcc.dg/assign-warn-1.c: Update.
* gcc.dg/dfp/composite-type.c: Update.
* gcc.dg/simd-1.c: Update.
* gcc.dg/pr36997.c: Update.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141298 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-typeck.c')
-rw-r--r-- | gcc/c-typeck.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index da98c43c4bf..52042fa6577 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -4012,7 +4012,8 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype, { \ case ic_argpass: \ if (pedwarn (LOCATION, OPT, AR, parmnum, rname)) \ - inform (fundecl ? DECL_SOURCE_LOCATION (fundecl) : LOCATION, \ + inform ((fundecl && !DECL_IS_BUILTIN (fundecl)) \ + ? DECL_SOURCE_LOCATION (fundecl) : LOCATION, \ "expected %qT but argument is of type %qT", \ type, rhstype); \ break; \ @@ -4451,15 +4452,21 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype, /* ??? This should not be an error when inlining calls to unprototyped functions. */ error ("incompatible type for argument %d of %qE", parmnum, rname); + inform ((fundecl && !DECL_IS_BUILTIN (fundecl)) + ? DECL_SOURCE_LOCATION (fundecl) : input_location, + "expected %qT but argument is of type %qT", type, rhstype); break; case ic_assign: - error ("incompatible types in assignment"); + error ("incompatible types when assigning to type %qT from type %qT", + type, rhstype); break; case ic_init: - error ("incompatible types in initialization"); + error ("incompatible types when initializing type %qT using type %qT", + type, rhstype); break; case ic_return: - error ("incompatible types in return"); + error ("incompatible types when returning type %qT but %qT was expected", + rhstype, type); break; default: gcc_unreachable (); |