Skip to content

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

Description

@catsidhe

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';
      |                       ~~~        ^~~~~~~~

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions