[Nasm-bugs] [Bug 3392465] New: -Wimplicit-fallthrough warnings

no-reply at bugzilla-nasm.gorcunov.org no-reply at bugzilla-nasm.gorcunov.org
Thu Feb 22 23:20:19 PST 2018


https://bugzilla.nasm.us/show_bug.cgi?id=3392465

            Bug ID: 3392465
           Summary: -Wimplicit-fallthrough warnings
           Product: NASM
           Version: 2.14 (development)
          Hardware: All
                OS: All
            Status: OPEN
          Severity: normal
          Priority: Medium
         Component: Assembler
          Assignee: nobody at nasm.us
          Reporter: sezeroz at gmail.com
                CC: gorcunov at gmail.com, hpa at zytor.com, nasm-bugs at nasm.us
     Obtained from: Built from git using configure

Current git master has the following warnings from gcc7:

asm/listing.c: In function ‘list_output’:
asm/listing.c:213:12: warning: this statement may fall through
[-Wimplicit-fallthrough=]
         if (size > 16) {
            ^
asm/listing.c:220:5: note: here
     case OUT_RAWDATA:
     ^~~~
rdoff/rdflib.c: In function ‘main’:
rdoff/rdflib.c:232:12: warning: this statement may fall through
[-Wimplicit-fallthrough=]
         if (argc < 5) {
            ^
rdoff/rdflib.c:236:5: note: here
     case 't':
     ^~~~
rdoff/rdflib.c:319:13: warning: this statement may fall through
[-Wimplicit-fallthrough=]
         argc--;
         ~~~~^~
rdoff/rdflib.c:320:5: note: here
     case 'd':                  /* delete module */
     ^~~~



The following silences them for me:

diff --git a/asm/listing.c b/asm/listing.c
index 9409aa90..b666f879 100644
--- a/asm/listing.c
+++ b/asm/listing.c
@@ -215,8 +215,8 @@ static void list_output(const struct out_data *data)
             list_out(offset, q);
         } else {
             p = zero_buffer;
-            /* fall through */
         }
+        /* fall through */
     case OUT_RAWDATA:
     {
        if (size == 0 && !listdata[0])
diff --git a/rdoff/rdflib.c b/rdoff/rdflib.c
index ee7f19f6..8975878c 100644
--- a/rdoff/rdflib.c
+++ b/rdoff/rdflib.c
@@ -233,6 +233,7 @@ int main(int argc, char **argv)
             fprintf(stderr, "rdflib: required parameter missing\n");
             exit(1);
         }
+        /* fall through */
     case 't':
         fp = fopen(argv[2], "rb");
         if (!fp) {
@@ -316,7 +317,7 @@ int main(int argc, char **argv)
         break;

     case 'r':                  /* replace module */
-        argc--;
+        argc--;                /* fall through */
     case 'd':                  /* delete module */
         if (argc < 4) {
             fprintf(stderr, "rdflib: required parameter missing\n");

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are watching all bug changes.


More information about the Nasm-bugs mailing list