suppress additional output when disabling warning 18
[debian/cc1111] / debian / patches / suppress-additional-output-when-disabling-warning-18
1 From 0ac4b0e0021c0664e12fa060ffdf59c7ebd0e679 Mon Sep 17 00:00:00 2001
2 From: Eric Cooper <ecc@cmu.edu>
3 Date: Fri, 8 May 2015 12:32:53 -0400
4 Subject: [PATCH] suppress additional output when disabling warning 18
5
6 Signed-off-by: Eric Cooper <ecc@cmu.edu>
7 ---
8  src/SDCCglue.c | 6 ++++--
9  1 file changed, 4 insertions(+), 2 deletions(-)
10
11 diff --git a/src/SDCCglue.c b/src/SDCCglue.c
12 index f753441..46c1ead 100644
13 --- a/src/SDCCglue.c
14 +++ b/src/SDCCglue.c
15 @@ -352,7 +352,8 @@ initPointer (initList * ilist, sym_link *toType)
16        IS_AST_OP(expr->right) && expr->right->opval.op=='&') {
17      if (compareType(toType, expr->left->ftype)!=1) {
18        werror (W_INIT_WRONG);
19 -      printFromToType(expr->left->ftype, toType);
20 +      if (!_SDCCERRG.disabled[W_INIT_WRONG])
21 +          printFromToType(expr->left->ftype, toType);
22      }
23      // skip the cast ???
24      expr=expr->right;
25 @@ -1075,7 +1076,8 @@ printIvalPtr (symbol * sym, sym_link * type, initList * ilist, struct dbuf_s * o
26    /* check the type      */
27    if (compareType (type, val->type) == 0) {
28      werrorfl (ilist->filename, ilist->lineno, W_INIT_WRONG);
29 -    printFromToType (val->type, type);
30 +    if (!_SDCCERRG.disabled[W_INIT_WRONG])
31 +        printFromToType (val->type, type);
32    }
33  
34    /* if val is literal */
35 -- 
36 2.1.4
37