Skip to content
This repository has been archived by the owner on Jun 12, 2018. It is now read-only.

fix HTTP version checking, silence compiler warnings #110

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dsiroky
Copy link
Contributor

@dsiroky dsiroky commented Feb 13, 2017

No description provided.

e.g. stof("1.1") might return 1.0 if the locale decimal delimiter is ","
@eidheim
Copy link
Owner

eidheim commented Feb 13, 2017

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

@dsiroky
Copy link
Contributor Author

dsiroky commented Feb 14, 2017

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

  • variable shadowing - potential future risk of using a wrong one
  • int conversions - inconsistencies in using long/size_t etc...

David

@eidheim
Copy link
Owner

eidheim commented Feb 14, 2017

For now I added 50ce751.

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
Copy link
Contributor Author

dsiroky commented Feb 15, 2017

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

@eidheim
Copy link
Owner

eidheim commented Feb 15, 2017

size_t was chosen due to being an unsigned datatype.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants