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

Remove signed <-> unsigned warnings around size_t #72

Merged
merged 1 commit into from
Feb 15, 2019

Conversation

mrkline
Copy link
Contributor

@mrkline mrkline commented Feb 15, 2019

These get flagged by recent versions of GCC and Clang when building
with -Wsign-conversion.

These get flagged by recent versions of GCC and Clang when building
with -Wsign-conversion.
@Taywee Taywee merged commit 8f8f1db into Taywee:master Feb 15, 2019
@darealshinji
Copy link
Contributor

Makes the build fail though on GCC 4.8.4:

In file included from <builddir>/main.cpp:27:0:
<builddir>/args.hxx: In member function ‘It args::ArgumentParser::Parse(It, It)’:
<builddir>/args.hxx:2722:72: error: expected type-specifier before ‘ptrdiff_t’
                                     const auto signedIdx = static_cast<ptrdiff_t>(idx);
                                                                        ^
<builddir>/args.hxx:2722:72: error: expected ‘>’ before ‘ptrdiff_t’
<builddir>/args.hxx:2722:72: error: expected ‘(’ before ‘ptrdiff_t’
<builddir>/args.hxx:2722:72: error: ‘ptrdiff_t’ was not declared in this scope
<builddir>/args.hxx:2722:72: note: suggested alternatives:
In file included from /usr/include/c++/4.8/utility:68:0,
                 from /usr/include/c++/4.8/algorithm:60,
                 from <builddir>/args.hxx:32,
                 from <builddir>/main.cpp:27:
/usr/include/x86_64-linux-gnu/c++/4.8/bits/c++config.h:187:28: note:   ‘std::ptrdiff_t’
   typedef __PTRDIFF_TYPE__ ptrdiff_t;
                            ^
/usr/include/x86_64-linux-gnu/c++/4.8/bits/c++config.h:187:28: note:   ‘std::ptrdiff_t’
In file included from <builddir>/main.cpp:27:0:
<builddir>/args.hxx:2722:87: error: expected ‘)’ before ‘;’ token
                                     const auto signedIdx = static_cast<ptrdiff_t>(idx);
                                                                                       ^

@Taywee
Copy link
Owner

Taywee commented Mar 2, 2019

I've pushed a change that uses an explicit cstddef and std::ptrdiff_t instead; that might fix that issue.

@darealshinji
Copy link
Contributor

Now it works. Thanks.

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

Successfully merging this pull request may close these issues.

3 participants