Change G_DECLARE_* macro struct naming to stop undefined behaviour
Submitted by Alex Puchades
Link to original bug (#748258)
Description
The G_DECLARE_* macros, which appeared in GLib-2.43 IIRC, are a means of reducing the required boilerplate while declaring a GObject. Unfortunately, while doing so, as of GLib-2.45, they invoke Undefined Behaviour [1], naming the resulting type struct with a leading underscore. That's probably due to the documentation [2] suggesting that as a convention, which is also used extensively along GLib (and include guards [3] too). However, there's no reason to keep that invalid behaviour (as of the C Standard) when there are other valid alternatives [3], the required changes are very minor and the chance of code breaking is very unlikely.
I also proposed those changes on the documentation [3].
Since the required changes are very minor and mechanical, I can make the patch myself, but I'd like to know beforehand what are the chances of something along those lines getting accepted.
Regards,
[1] http://www.gnu.org/software/libc/manual/html_node/Reserved-Names.html [2] https://developer.gnome.org/programming-guidelines/unstable/c-coding-style.html.en [3] https://bugzilla.gnome.org/show_bug.cgi?id=748216
Version: 2.43.x