Improve compiler detection for pragma directives
Compiling with clang 17 I get a couple of warnings due to the #pragma GCC
directives, because checking for __GNUC__
is not enough to distinguish between GCC and clang (clang also defines it, see https://stackoverflow.com/a/55926503) so I added a check for that in most cases. In the second commit I remove it for some unit tests, since it seems using some deprecated methods is the intended way. I also removed one case of pragmas for GCC 9 and older which is too old now.