tags 784273 patch thanks On Thu, May 07, 2015 at 06:04:04PM -0600, Bdale Garbee wrote: > Eric Cooper <e...@cooper-siegel.org> writes: > > > Why does the __code storage class affect it? > > Neither Keith nor I have any idea. Have you tried the same code with > current SDCC to see if things perhaps work better there?
Yes, sdcc compiles both versions (with and without __code) with no warnings. The warning is still in the code (in SDCCglue.c), but I couldn't come up with any input that would trigger it. While I was looking at the code, I saw that the fix for my original complaint was pretty trivial, so I've attached a patch. -- Eric Cooper e c c @ c m u . e d u
>From 0ac4b0e0021c0664e12fa060ffdf59c7ebd0e679 Mon Sep 17 00:00:00 2001 From: Eric Cooper <e...@cmu.edu> Date: Fri, 8 May 2015 12:32:53 -0400 Subject: [PATCH] suppress additional output when disabling warning 18 Signed-off-by: Eric Cooper <e...@cmu.edu> --- src/SDCCglue.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/SDCCglue.c b/src/SDCCglue.c index f753441..46c1ead 100644 --- a/src/SDCCglue.c +++ b/src/SDCCglue.c @@ -352,7 +352,8 @@ initPointer (initList * ilist, sym_link *toType) IS_AST_OP(expr->right) && expr->right->opval.op=='&') { if (compareType(toType, expr->left->ftype)!=1) { werror (W_INIT_WRONG); - printFromToType(expr->left->ftype, toType); + if (!_SDCCERRG.disabled[W_INIT_WRONG]) + printFromToType(expr->left->ftype, toType); } // skip the cast ??? expr=expr->right; @@ -1075,7 +1076,8 @@ printIvalPtr (symbol * sym, sym_link * type, initList * ilist, struct dbuf_s * o /* check the type */ if (compareType (type, val->type) == 0) { werrorfl (ilist->filename, ilist->lineno, W_INIT_WRONG); - printFromToType (val->type, type); + if (!_SDCCERRG.disabled[W_INIT_WRONG]) + printFromToType (val->type, type); } /* if val is literal */ -- 2.1.4