eidheim / Simple-Web-Server

A very simple, fast, multithreaded, platform independent HTTP and HTTPS server and client library implemented using C++11 and Boost.Asio. Created to be an easy way to make REST resources available from C++ applications.
MIT License
2.62k stars 758 forks source link

fix HTTP version checking, silence compiler warnings #110

Open dsiroky opened 7 years ago

eidheim commented 7 years ago

Thank you, but regarding the warnings, what compiler are you using?

dsiroky commented 7 years ago

Hi! gcc, clang (-Wshadow), msvc++ (C4267)

David

eidheim commented 7 years ago

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.

dsiroky commented 7 years ago

Is there a purpose having those variables declared as "size_t"? I see them only being passed to functions as "long" parameters.

eidheim commented 7 years ago

size_t was chosen due to being an unsigned datatype.