summaryrefslogtreecommitdiffstats
path: root/gcc/c-typeck.c
diff options
context:
space:
mode:
authormanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-28 19:34:36 +0000
committermanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-28 19:34:36 +0000
commit3230bfa8e6bc4569fba44d8c2e4807ddf2a8f06e (patch)
tree63b0322b8155dda59f3357e394cb4dd3af952625 /gcc/c-typeck.c
parentf6c7e4afa3fdbe93f5670349dd03ca5733ef4bef (diff)
downloadppe42-gcc-3230bfa8e6bc4569fba44d8c2e4807ddf2a8f06e.tar.gz
ppe42-gcc-3230bfa8e6bc4569fba44d8c2e4807ddf2a8f06e.zip
2008-08-28 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR c/30949 * c-typeck.c (convert_for_assignment): Give a note describing what was passed and what was expected. testsuite/ * gcc.dg/pr30949.c: New. * gcc.dg/transparent-union-1.c: Update. * gcc.dg/cleanup-1.c: Update. * gcc.dg/assign-warn-2.c: Update. * gcc.dg/conv-2.c: Update. * gcc.dg/Wpointer-sign-pedantic.c: Update. * gcc.dg/Wpointer-sign-Wall.c: Update. * gcc.dg/assign-warn-1.c: Update. * gcc.dg/dfp/composite-type.c: Update. * gcc.dg/noncompile/20020213-1.c: Update. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139729 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-typeck.c')
-rw-r--r--gcc/c-typeck.c47
1 files changed, 25 insertions, 22 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 9f725884e46..85a94443a6e 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -3952,28 +3952,31 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
/* This macro is used to emit diagnostics to ensure that all format
strings are complete sentences, visible to gettext and checked at
compile time. */
-#define WARN_FOR_ASSIGNMENT(LOCATION, OPT, AR, AS, IN, RE) \
- do { \
- switch (errtype) \
- { \
- case ic_argpass: \
- pedwarn (LOCATION, OPT, AR, parmnum, rname); \
- break; \
- case ic_argpass_nonproto: \
- warning (OPT, AR, parmnum, rname); \
- break; \
- case ic_assign: \
- pedwarn (LOCATION, OPT, AS); \
- break; \
- case ic_init: \
- pedwarn (LOCATION, OPT, IN); \
- break; \
- case ic_return: \
- pedwarn (LOCATION, OPT, RE); \
- break; \
- default: \
- gcc_unreachable (); \
- } \
+#define WARN_FOR_ASSIGNMENT(LOCATION, OPT, AR, AS, IN, RE) \
+ do { \
+ switch (errtype) \
+ { \
+ case ic_argpass: \
+ if (pedwarn (LOCATION, OPT, AR, parmnum, rname)) \
+ inform (fundecl ? DECL_SOURCE_LOCATION (fundecl) : LOCATION, \
+ "expected %qT but argument is of type %qT", \
+ type, rhstype); \
+ break; \
+ case ic_argpass_nonproto: \
+ warning (OPT, AR, parmnum, rname); \
+ break; \
+ case ic_assign: \
+ pedwarn (LOCATION, OPT, AS); \
+ break; \
+ case ic_init: \
+ pedwarn (LOCATION, OPT, IN); \
+ break; \
+ case ic_return: \
+ pedwarn (LOCATION, OPT, RE); \
+ break; \
+ default: \
+ gcc_unreachable (); \
+ } \
} while (0)
STRIP_TYPE_NOPS (rhs);
OpenPOWER on IntegriCloud