Open dsiroky opened 7 years ago
Hi! gcc, clang (-Wshadow), msvc++ (C4267)
David
For now I added https://github.com/eidheim/Simple-Web-Server/commit/50ce7510efe58ffea1e77351c0dc7a32eda5f46a.
I don't enforce a whitespace policy, as long as there are no cleanup whitespace commits:)
Regarding the warnings, these are warnings that are not shown when enabling -Wall and -Wextra
, but it is strange that -Wunused-parameter
(part of the all or extra group) is not triggered on catch
parameters.
I have decided earlier not to use the shadow warnings in my projects. Partially due to personal preference and partially due to lack of a standard convention on how to deal with this. Also there are occasions where one just as well can introduce bugs when fixing shadow warnings (for instance when not renaming all variable name occurrences).
When it comes to inconsistencies in using long/size_t, these are only really dangerous when doing comparisons, and clang and gcc give warnings in these occurrences. It seems that msvc++ is somewhat eager when it comes to these warnings.
Feel free to include the header files using system includes in your project, however, and in that way silence the warnings.
Is there a purpose having those variables declared as "size_t"? I see them only being passed to functions as "long" parameters.
size_t
was chosen due to being an unsigned datatype.
Thank you, but regarding the warnings, what compiler are you using?