Skip to main content
added 1030 characters in body
Source Link

What if I add more "<p" ?

  • 1 byte -> 70 bytes error, ratio = 70
    $ echo 'p' > test.cpp; g++-11 test.cpp -o test -std=c++20 2>&1 | wc -c
    70
    
  • 3 byte -> 636 bytes error, ratio = 212
    $ echo 'p<p' > test.cpp; g++-11 test.cpp -o test -std=c++20 2>&1 | wc -c
    636
    
  • 5 byte -> 7608 bytes error, ratio = 1521.6
    $ echo 'p<p<p' > test.cpp; g++-11 test.cpp -o test -std=c++20 2>&1 | wc -c
    7608
    
  • 7 byte -> 88884 bytes error, ratio = 12697.7142857
    $ echo 'p<p<p<p' > test.cpp; g++-11 test.cpp -o test -std=c++20 2>&1 | wc -c
    88884
    
  • 9 byte -> 1031892 bytes error, ratio = 114654.666667
    $ echo 'p<p<p<p<p' > test.cpp; g++-11 test.cpp -o test -std=c++20 2>&1 | wc -c
    1031892
    
  • 11 byte -> 12132840 bytes error, ratio = 1102985.45455
    $ echo 'p<p<p<p<p<p' > test.cpp; g++-11 test.cpp -o test -std=c++20 2>&1 | wc -c
    12132840
    
  • ...and latter take too much time to evaluate.

What if I add more "<p" ?

  • 1 byte -> 70 bytes error, ratio = 70
    $ echo 'p' > test.cpp; g++-11 test.cpp -o test -std=c++20 2>&1 | wc -c
    70
    
  • 3 byte -> 636 bytes error, ratio = 212
    $ echo 'p<p' > test.cpp; g++-11 test.cpp -o test -std=c++20 2>&1 | wc -c
    636
    
  • 5 byte -> 7608 bytes error, ratio = 1521.6
    $ echo 'p<p<p' > test.cpp; g++-11 test.cpp -o test -std=c++20 2>&1 | wc -c
    7608
    
  • 7 byte -> 88884 bytes error, ratio = 12697.7142857
    $ echo 'p<p<p<p' > test.cpp; g++-11 test.cpp -o test -std=c++20 2>&1 | wc -c
    88884
    
  • 9 byte -> 1031892 bytes error, ratio = 114654.666667
    $ echo 'p<p<p<p<p' > test.cpp; g++-11 test.cpp -o test -std=c++20 2>&1 | wc -c
    1031892
    
  • 11 byte -> 12132840 bytes error, ratio = 1102985.45455
    $ echo 'p<p<p<p<p<p' > test.cpp; g++-11 test.cpp -o test -std=c++20 2>&1 | wc -c
    12132840
    
  • ...and latter take too much time to evaluate.
Source Link

1031892 bytes / 9 bytes = ratio 114654.666667

Compiler g++-11, with -std=c++20 flag

p<p<p<p<p

produces 1031892 bytes, or 21056 lines of error.

first 20 lines look like this:

test.cpp:1:9: error: ‘p’ was not declared in this scope
    1 | p<p<p<p<p
      |         ^
test.cpp:1:9: error: ‘p’ was not declared in this scope
test.cpp:1:9: error: ‘p’ was not declared in this scope
test.cpp:1:9: error: ‘p’ was not declared in this scope
test.cpp:1:9: error: ‘p’ was not declared in this scope
test.cpp:1:9: error: ‘p’ was not declared in this scope
test.cpp:1:9: error: ‘p’ was not declared in this scope
test.cpp:1:9: error: ‘p’ was not declared in this scope
test.cpp:1:9: error: ‘p’ was not declared in this scope
test.cpp:1:9: error: ‘p’ was not declared in this scope
test.cpp:1:9: error: ‘p’ was not declared in this scope
test.cpp:1:7: error: ‘p’ was not declared in this scope
    1 | p<p<p<p<p
      |       ^
test.cpp:1:9: error: ‘p’ was not declared in this scope
    1 | p<p<p<p<p
      |         ^
test.cpp:1:9: error: ‘p’ was not declared in this scope

and last 20 lines:

      |         ^
test.cpp:1:5: error: ‘p’ was not declared in this scope
    1 | p<p<p<p<p
      |     ^
test.cpp:1:9: error: ‘p’ was not declared in this scope
    1 | p<p<p<p<p
      |         ^
test.cpp:1:9: error: ‘p’ was not declared in this scope
test.cpp:1:9: error: ‘p’ was not declared in this scope
test.cpp:1:9: error: ‘p’ was not declared in this scope
test.cpp:1:9: error: ‘p’ was not declared in this scope
test.cpp:1:7: error: ‘p’ was not declared in this scope
    1 | p<p<p<p<p
      |       ^
test.cpp:1:9: error: ‘p’ was not declared in this scope
    1 | p<p<p<p<p
      |         ^
test.cpp:1:1: error: ‘p’ does not name a type
    1 | p<p<p<p<p
      | ^

And my compiler version:

$ g++-11 --version
g++-11 (Ubuntu 11.1.0-1ubuntu1~18.04.1) 11.1.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.