Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

about 3 years ago

Language

C++

Compiler

gcc HEAD 14.0.0 20230620 (experimental)

Options
Warnings
Optimization
Don't Use Boost
C++17
no pedantic
Raw compiler options
-O3

Author

anonymous

about 3 years ago

$ g++ prog.cc -Wall -Wextra -O2 -march=native -std=c++17 -O3
prog.cc: In function 'bool LikeVBA(const wchar_t*, const wchar_t*)':
prog.cc:567:78: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
  567 |         else if (*pattern == L'?' || *string == *pattern && *pattern != L'[' && *pattern != L'#') {
      |                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
prog.cc: In function 'bool LikeVBAF(const wchar_t*, const wchar_t*)':
prog.cc:634:61: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
  634 |                     while (*string > L'9' || *string < L'0' && *string) { ++string; }
      |                                              ~~~~~~~~~~~~~~~^~~~~~~~~~
prog.cc: In function 'int main()':
prog.cc:781:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<const wchar_t*> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  781 |         for (int i = 0; i < testArr.size(); i++) {
      |                         ~~^~~~~~~~~~~~~~~~
prog.cc:788:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<const wchar_t*> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  788 |         for (int i = 0; i < testArr.size(); i++) {
      |                         ~~^~~~~~~~~~~~~~~~
prog.cc:797:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<const wchar_t*> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  797 |         for (int i = 0; i < testArr.size(); i++) {
      |                         ~~^~~~~~~~~~~~~~~~
Test pattern...
LikeVBA...
LikeVBAF...
MatchWildcardAndText...

Speed test...1
check, ms: 28
1
LikeVBA, ms: 28
1
LikeVBAF, ms: 35
1
MatchWildcardAndText, ms: 62
1
Matching text: XYXZZXYXYXZZXY

regex_match, ms: 945
1

Speed test...2
LikeVBA, ms: 233
1
LikeVBAF, ms: 95
1
MatchWildcardAndText, ms: 490
1

Exit Code:
0