Although it makes me wonder if its extension shouldn't be ".sh", sinc e this polyglot-metaprogra. is really intended to be run as a shell script.
No, it shouldn't. sh do not look at extension of file, gcc does. It can bring some issues like the need of explicitly stating source's language for gcc in the command line.