Fix dangling reference warning in buildingplan plugin
fix #4534
A version check is needed in the macro definition. :(
updated
I don't like this compiler/version check, it's too complex. Can it be better? Maybe you want to wait for your tool chain to update to gcc 14 before fixing this issue.
"All attributes unknown to an implementation are ignored without causing an error" so if an undefined attribute is causing a compilation error this itself is a compiler bug.
We are not likely to move to gcc 14 any time soon due to basically nonexistent support for gcc 14's runtime in widely available distributions. Building DFHack with a version of gcc other than the one DF is built with (currently gcc 11) is unsupported.
"All attributes unknown to an implementation are ignored without causing an error" so if an undefined attribute is causing a compilation error this itself is a compiler bug.
It causes a warning and with -Werror it causes an error. See on compiler explorer
We are not likely to move to gcc 14 any time soon due to basically nonexistent support for gcc 14's runtime in widely available distributions. Building DFHack with a version of gcc other than the one DF is built with (currently gcc 11) is unsupported.
Yes, forget about this. I'll keep my workaround in my cmake configuration.
Yes, forget about this. I'll keep my workaround in my cmake configuration.
I think this can still be a useful addition. we don't distribute DFHack built with newer compilers, but we do build with newer compilers. We build with gcc-12 in CI, for example, to catch warnings that gcc-10 misses.
I would use the "pragma" approach to disable the warnings instead of using an attribute, since (I sincerely hope) that no compiler author is doofus enough to issue even so much as a warning for an unrecognized pragma. 🤦♀️