bug-groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #51483] [PATCH] Warning from the gcc compiler


From: Bjarni Ingi Gislason
Subject: [bug #51483] [PATCH] Warning from the gcc compiler
Date: Sun, 16 Jul 2017 16:59:55 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

URL:
  <http://savannah.gnu.org/bugs/?51483>

                 Summary: [PATCH]  Warning from the gcc compiler
                 Project: GNU troff
            Submitted by: bjarniig
            Submitted on: Sun 16 Jul 2017 08:59:54 PM UTC
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None

    _______________________________________________________

Details:


  In the first case the "fill_mode = mode" looks like it belongs to the
else-clause (same indention) but I don't see the logic in that.

  In the second case the else clause contains two statements in the same
line.


  Warning from the gcc compiler:

1) src/devices/grolbp/lbp.cpp: 

In member function 'void lbp_printer::setfillmode(int)':

390:5: warning: this 'else' clause does not guard...
[-Wmisleading-indentation]
     else
     ^~~~
393:7: note: ...this statement, but the latter is misleadingly indented as if
it is guarded by the 'else'
       fill_mode = mode;
       ^~~~~~~~~

2) src/roff/troff/mtsm.cpp: 

In member function 'void mtsm::push_state(statem*)':
377:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if (debug_state)
     ^~
378:63: note: ...this statement, but the latter is misleadingly indented as if
it is guarded by the 'if'
       fprintf(stderr, "--> state %d pushed\n", n->issue_no) ;
fflush(stderr);
                                                               ^~~~~~
In member function 'void mtsm::pop_state()':
388:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if (debug_state)
     ^~
389:47: note: ...this statement, but the latter is misleadingly indented as if
it is guarded by the 'if'
       fprintf(stderr, "--> state popped\n") ; fflush(stderr);
                                               ^~~~~~



>From 627423b8b18f6e0412632a24df83174a260b2259 Mon Sep 17 00:00:00 2001
From: Bjarni Ingi Gislason <address@hidden>
Date: Sun, 16 Jul 2017 20:43:58 +0000
Subject: [PATCH]   Warning from the gcc compiler:

1) src/devices/grolbp/lbp.cpp:

In member function 'void lbp_printer::setfillmode(int)':

390:5: warning: this 'else' clause does not guard...
[-Wmisleading-indentation]
     else
     ^~~~
393:7: note: ...this statement, but the latter is misleadingly indented as if
it is guarded by the 'else'
       fill_mode = mode;
       ^~~~~~~~~

2) src/roff/troff/mtsm.cpp:

In member function 'void mtsm::push_state(statem*)':
377:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if (debug_state)
     ^~
378:63: note: ...this statement, but the latter is misleadingly indented as if
it is guarded by the 'if'
       fprintf(stderr, "--> state %d pushed\n", n->issue_no) ;
fflush(stderr);
                                                               ^~~~~~
In member function 'void mtsm::pop_state()':
388:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if (debug_state)
     ^~
389:47: note: ...this statement, but the latter is misleadingly indented as if
it is guarded by the 'if'
       fprintf(stderr, "--> state popped\n") ; fflush(stderr);
                                               ^~~~~~

Signed-off-by: Bjarni Ingi Gislason <address@hidden>
---
 src/devices/grolbp/lbp.cpp | 5 +++--
 src/roff/troff/mtsm.cpp    | 6 ++++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/devices/grolbp/lbp.cpp b/src/devices/grolbp/lbp.cpp
index fbd1bbf5..aaa03886 100644
--- a/src/devices/grolbp/lbp.cpp
+++ b/src/devices/grolbp/lbp.cpp
@@ -387,10 +387,11 @@ inline void lbp_printer::setfillmode(int mode)
   if (mode != fill_mode) {
     if (mode != 1)
       vdmsetfillmode(mode, 1, 0);
-    else
+    else {
       vdmsetfillmode(mode, 1, 1);      // To get black we must use white
                                        // inverted
-      fill_mode = mode;
+    }
+    fill_mode = mode;
   }
 }
 
diff --git a/src/roff/troff/mtsm.cpp b/src/roff/troff/mtsm.cpp
index 0fd2d33f..dcf31ad9 100644
--- a/src/roff/troff/mtsm.cpp
+++ b/src/roff/troff/mtsm.cpp
@@ -374,8 +374,9 @@ void mtsm::push_state(statem *n)
 {
   if (is_html) {
 #if defined(DEBUGGING)
-    if (debug_state)
+    if (debug_state) {
       fprintf(stderr, "--> state %d pushed\n", n->issue_no) ;
fflush(stderr);
+    }
 #endif
     sp = new stack(n, sp);
   }
@@ -385,8 +386,9 @@ void mtsm::pop_state()
 {
   if (is_html) {
 #if defined(DEBUGGING)
-    if (debug_state)
+    if (debug_state) {
       fprintf(stderr, "--> state popped\n") ; fflush(stderr);
+    }
 #endif
     if (sp == 0)
       fatal("empty state machine stack");
-- 
2.13.2






    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?51483>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]