fix: compiler warning `-Wswitch-enum`
authorGerrit Klein <therealthingy95@gmail.com>
Wed, 26 Apr 2023 21:44:56 +0000 (23:44 +0200)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 27 Apr 2023 14:28:53 +0000 (10:28 -0400)
Fixes warning "enumeration value ‘XXXX’ not handled in switch
[-Wswitch-enum]" which was observed on gcc 11.3.0 on Ubuntu 22.04 LTS
Linux 6.3.0 x86-64. This warning was enabled by the flag `-Wswitch-enum`
(see:
https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wswitch-enum)

Signed-off-by: Gerrit Klein <therealthingy95@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I86cde0be01bf32cb5f6ea0ad313001bba717a9ff

include/rseq/rseq.h

index 0989ef740be49a0d81a3c0754244bf9b0b3afa06..080508e2988de275367e101a8d571398fc72cfa1 100644 (file)
@@ -369,6 +369,10 @@ int rseq_cmpeqv_trystorev_storev(enum rseq_mo rseq_mo, enum rseq_percpu_mode per
                default:
                        return -1;
                }
+       case RSEQ_MO_ACQUIRE:   /* Fallthrough */
+       case RSEQ_MO_ACQ_REL:   /* Fallthrough */
+       case RSEQ_MO_CONSUME:   /* Fallthrough */
+       case RSEQ_MO_SEQ_CST:   /* Fallthrough */
        default:
                return -1;
        }
@@ -417,6 +421,10 @@ int rseq_cmpeqv_trymemcpy_storev(enum rseq_mo rseq_mo, enum rseq_percpu_mode per
                default:
                        return -1;
                }
+       case RSEQ_MO_ACQUIRE:   /* Fallthrough */
+       case RSEQ_MO_ACQ_REL:   /* Fallthrough */
+       case RSEQ_MO_CONSUME:   /* Fallthrough */
+       case RSEQ_MO_SEQ_CST:   /* Fallthrough */
        default:
                return -1;
        }
This page took 0.02633 seconds and 4 git commands to generate.