I often build C (and C++) code, using GCC (or clang) with the -Wall
flag turned on. Now I happen to need to make sure a small C project, which builds fine on Linux with this flag, also builds on Windows with MSVC.
However, if I run MSVC with -Wall
, I get many warnings which I find rather spurious, such as:
warning C4255: 'some_func': no function prototype given: converting '()' to '(void)'
- `warning C4820: 'some_struct': '4' bytes padding added after data member 'some_member'
and so on. Now, I realize I can suppress individual warnings with #pragma warning(disable:1234)
; but still: What's considered a common, reasonable combination of compiler warning switches for C code with MS Visual C++, which is roughly equivalent to gcc
/clang
's -Wall
switch?
Edit: If I were asking about -Wall -Wextra
, that would be this existing question.
Note: I'm using MSVC 2015 in case it matters - but not the IDE, just the compiler.