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

Clang complains about precision loss in trace.hpp when using -Wshorten-64-to-32 #370

Closed
catsidhe opened this issue Sep 11, 2024 · 1 comment
Assignees

Comments

@catsidhe
Copy link

When attempting to use complete_trace with clang version 18.1.8 and -Wshorten-64-to-32 option:

/usr/include/tao/pegtl/contrib/trace.hpp:87:34: fatal error: implicit conversion loses integer precision: 'std::size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
   87 |          std::cerr << std::setw( indent() ) << ' ' << TracerTraits::ansi_position << "position" << TracerTraits::ansi_reset << ' ' << m_position << '\n';
      |                       ~~~        ^~~~~~~~
ColinH added a commit that referenced this issue Sep 14, 2024
@ColinH ColinH self-assigned this Sep 14, 2024
@ColinH
Copy link
Member

ColinH commented Sep 14, 2024

Quick fix is in 3.2.8, fixes for the main and work branches will follow soon.

@ColinH ColinH closed this as completed Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants