Compiler showing 'pi' symbol on error,compilershowing
Question:
I was testing some code on Coliru, and I got a strange output. I went down the code and could reproduce it with this simplepiece of code:
int main(){ π}
The output on g++:
clang:
For instance, using just pi (without the address-of) shows the expected result:
main.cpp:3:5: error: 'pi' was not declared in this scope pi; ^
I tried to reproduce this on my machine, using g++ 4.9.2 and on others sites but I could not.
Is this some bug on this site, some config of these compilers ?
And why only using the address-of operator (&) shows this symbol ?
Answer:
It's a bug on the site, as the compiler's output is not properly escaped. The compiler should outputπ, but that's valid HTML, producing the pi symbol you see.
website:
http://stackoverflow.com/questions/28885876/compiler-showing-pi-symbol-on-error