Skip to content

[\x80-\xBF] - warning: comparison of integer expressions of different signedness #330

Open
@Alcaro

Description

@Alcaro
int square(int num) {
    return ctre::starts_with<R"([\x80-\xBF])">("abc");
}
<source>: In instantiation of 'static constexpr bool ctre::char_range<A, B>::match_char(CharT, const ctre::flags&) [with CharT = char; auto A = 128; auto B = 191]':
<source>:1609:30:   required from here
 1609 |                 return (Content::match_char(value, f) || ... || false);
      |                         ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
<source>:5984:47:   in 'constexpr' expansion of 'ctre::starts_with<ctll::fixed_string<11>{char32_t [11]{91, 92, 120, 56, 48, 45, 92, 120, 66, 70, 93}, 11, true}>.ctre::regular_expression<ctre::set<ctre::char_range<128, 191> >, ctre::starts_with_method, ctll::list<ctre::singleline> >::operator()<const char (&)[4]>("abc")'
<source>:5651:14:   in 'constexpr' expansion of 'ctre::regular_expression<ctre::set<ctre::char_range<128, 191> >, ctre::starts_with_method, ctll::list<ctre::singleline> >::exec(((const char*)std::forward<const char (&)[4]>((* & args#0))))'
<source>:5623:41:   in 'constexpr' expansion of 'ctre::starts_with_method::exec<ctll::list<ctre::singleline> >(s, (ctre::zero_terminated_string_end_iterator(), ctre::zero_terminated_string_end_iterator()), (ctre::set<ctre::char_range<128, 191> >(), ctre::set<ctre::char_range<128, 191> >()))'
<source>:5559:40:   in 'constexpr' expansion of 'ctre::starts_with_method::exec<ctll::list<ctre::singleline>, void, ctre::set<ctre::char_range<128, 191> >, const char*, ctre::zero_terminated_string_end_iterator>(begin, begin, (end, ctre::zero_terminated_string_end_iterator()), (ctre::set<ctre::char_range<128, 191> >(), ctre::set<ctre::char_range<128, 191> >()))'
<source>:5555:18:   in 'constexpr' expansion of 'ctre::evaluate<regex_results<const char*>, const char*, const char*, zero_terminated_string_end_iterator, set<char_range<128, 191> >, end_mark, accept>(orig_begin, begin, (end, ctre::zero_terminated_string_end_iterator()), ctre::flags((ctll::list<ctre::singleline>(), ctll::list<ctre::singleline>())), ctre::regex_results<const char*>(), (ctll::list<ctre::start_mark, ctre::set<ctre::char_range<128, 191> >, ctre::end_mark, ctre::accept>(), ctll::list<ctre::start_mark, ctre::set<ctre::char_range<128, 191> >, ctre::end_mark, ctre::accept>()))'
<source>:4607:17:   in 'constexpr' expansion of 'ctre::evaluate<regex_results<const char*>, const char*, const char*, zero_terminated_string_end_iterator, set<char_range<128, 191> >, end_mark, accept>(((const char*)begin), current, (last, const ctre::zero_terminated_string_end_iterator()), (* & f), (*(const ctre::regex_results<const char*>*)(& captures.ctre::regex_results<const char*>::set_start_mark(current))), (ctll::list<ctre::set<ctre::char_range<128, 191> >, ctre::end_mark, ctre::accept>(), ctll::list<ctre::set<ctre::char_range<128, 191> >, ctre::end_mark, ctre::accept>()))'
<source>:4631:32:   in 'constexpr' expansion of 'ctre::set<ctre::char_range<128, 191> >::match_char<char>(((int)((char)(* current))), (* & f))'
<source>:1636:31: warning: comparison of integer expressions of different signedness: 'char' and 'char32_t' [-Wsign-compare]
 1636 |                 return (value >= A) && (value <= B);
      |                        ~~~~~~~^~~~~
<source>:1636:47: warning: comparison of integer expressions of different signedness: 'char' and 'char32_t' [-Wsign-compare]
 1636 |                 return (value >= A) && (value <= B);
      |                                        ~~~~~~~^~~~~

https://godbolt.org/z/P8oeE73fM

Activity

linked a pull request that will close this issue on Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @Alcaro

      Issue actions

        [\x80-\xBF] - warning: comparison of integer expressions of different signedness · Issue #330 · hanickadot/compile-time-regular-expressions