suppress additional output when disabling warning 18
[debian/cc1111] / debian / patches / suppress-additional-output-when-disabling-warning-18
diff --git a/debian/patches/suppress-additional-output-when-disabling-warning-18 b/debian/patches/suppress-additional-output-when-disabling-warning-18
new file mode 100644 (file)
index 0000000..a2ef665
--- /dev/null
@@ -0,0 +1,37 @@
+From 0ac4b0e0021c0664e12fa060ffdf59c7ebd0e679 Mon Sep 17 00:00:00 2001
+From: Eric Cooper <ecc@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 <ecc@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
+