Skip to content

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

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

Open
Alcaro opened this issue Oct 24, 2024 · 0 comments · May be fixed by #342
Open

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

Alcaro opened this issue Oct 24, 2024 · 0 comments · May be fixed by #342

Comments

@Alcaro
Copy link

Alcaro commented Oct 24, 2024

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

@Alcaro Alcaro linked a pull request Apr 11, 2025 that will close this issue
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 a pull request may close this issue.

1 participant