switch missing default label warning under clang
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 45/100
Direzione di ricerca
Leggi include/boost/function/function_base.hpp intorno all’enum alla riga 105 e allo switch alla riga 147, quindi riproduci l’avviso con clang 19.1.7 e i flag di avviso indicati. Controlla le linee guida del progetto prima di scegliere tra una soppressione e un caso default, e considera l’issue conclusa quando l’errore -Wswitch-default segnalato non si verifica più senza modifiche involontarie al comportamento.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
When compiling under clang 19.1.7 with werror and a number of other flags (we run with most warnings enabled), the line https://github.com/boostorg/function/blob/develop/include/boost/function/function_base.hpp#L147 is flagged with error: switch missing default label [-Werror,-Wswitch-default]. Given this is based on the enum at https://github.com/boostorg/function/blob/f6b538dbed2e3047dcbd09eb3f5c7f1ffa90d0a9/include/boost/function/function_base.hpp#L105 and all cases are handled a pr has not been provided at this time. I see two approaches, one is doing a compiler warning suppression and the other is adding the default label with a throw or similar as it should be an unreachable place based on the current code. The suppression seems like the simpler answer but may cause a future update to the enum to be missed here while the throw would prevent that at the cost of potentially changing behavior if something is flagged nothrow. Happy to submit a PR but would need guidance no how it should be approached here.
Env:
Alma 9.6
Boost 1.88.0 via cmake
clang 19.1.7
- Lingua principale
- C++
- Stelle
- 26
- Fork
- 58
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Issue simili
-
AuTest Bug Tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/trafficserver#13714 ·
-
bug build
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
facebookincubator/velox#19143 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
tenstorrent/tt-metal#57393 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
objectionary/eo-graphs#74 ·