Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with Pedantic compiling #51

Open
xMAC94x opened this issue Jan 9, 2017 · 2 comments
Open

Issues with Pedantic compiling #51

xMAC94x opened this issue Jan 9, 2017 · 2 comments

Comments

@xMAC94x
Copy link

xMAC94x commented Jan 9, 2017

Hey,
while installing the library in my project i got 2 compiler warnings due to my pedantic settings ("/W4" under Windows, "-Wall -Wextra -Werror -Wno-long-long -Wpedantic" under linux).

It would be cool if you could fix them in the original code, this is the diff i used to fix both errors, however you should have a brief look the solution because i just started working with c++:

1st Error: compiler warning because of possible lost of data when converting size_t to unsigned
2nd Error: isspace returns an int, but the function should return a bool

 backward.hpp
@@ -435,7 +435,7 @@ struct Trace {
 		addr(0), idx(0) {}
 
 	explicit Trace(void* addr, size_t idx):
- 		addr(addr), idx(idx) {}
+ 		addr(addr), idx(unsigned(idx)) {}
 };
 
 struct ResolvedTrace: public Trace {
@@ -1520,7 +1520,7 @@ public:
 		// What a good boy am I.
 		struct isspace {
 			bool operator()(char c) {
- 				return std::isspace(c);
+ 				return std::isspace(c) != 0;
 			}
 		};
@bombela
Copy link
Owner

bombela commented Jan 9, 2017

We should probably change the type of the attribute idx to size_t.

@HorstBaerbel
Copy link

We should probably change the type of the attribute idx to size_t.

And compile with warnings==errors.
There's some more warnings in

EnumProcessModules(process, &module_handles[0],
ff (I suppose, I don't have the git version) due to the conversion from size_t to DWORD.

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

No branches or pull requests

3 participants