Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Activity for Zoe
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Comment | Post #292535 |
> We're already using -Wswitch, the problem is that nothing triggers for Clang when all of the enum's cases are accounted for in the switch
Yeah, you'd have to combine `-Wswitch` and `-Wreturn-type` for full coverage. Again, not optimal, but it is what it is right now.
Would definitely be nice... (more) |
— | 2 months ago |
Edit | Post #292535 | Initial revision | — | 2 months ago |
Answer | — |
A: How can I get the same "not all control paths return a value" behaviour across Clang and MSVC? You can't - but there are some workarounds. Based on two answers from the VS forums (1 (2020), 2 (2023)), this behaviour is by design, and it doesn't appear to be configurable. Aside MSVC, GCC works the same way: ``` ❯ g++ test6.cpp -Werror=return-type test6.cpp: In function ‘int toNum(Lett... (more) |
— | 2 months ago |