GNOME Bugzilla – Bug 670751
IceWM build fails due to the G_DEPRECATED_FOR macro
Last modified: 2012-03-03 18:30:18 UTC
Created attachment 208358 [details] [review] Patch to fix this error IceWM build fails due to G_DEPRECATED_FOR macro which used in glib-2.31.0. Reproduce the failure is easy, just build IceWM using glib-2.31.0. The reason for this failure is as follows: Glib defines the G_DEPRECATED_FOR macro which expands " __attribute__((deprecated("Use '" #f "' instead")))", and IceWM defines a macro "deprecated" which expands to "__attribute__((deprecated))". So, G_DEPRECATED_FOR macro expands to " __attribute__((__attribute__((deprecated))("Use '" #f "' instead")))". Attachment is the patch to fix it.
Review of attachment 208358 [details] [review]: no, this is broken. the attribute is: __attribute__((deprecated)). see: http://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html IceWM will need to be fixed: GLib is using a namespaced macro, and IceWM ought to do the same, to avoid collisions like these.
from the previous page of the gcc docs: "You may also specify attributes with `__' preceding and following each keyword. This allows you to use them in header files without being concerned about a possible macro of the same name. For example, you may use __noreturn__ instead of noreturn." We're already using __deprecated__ for G_GNUC_DEPRECATED. THere's no reason to not use it for G_GNUC_DEPRECATED_FOR too
While clearly the IceWM people are lame for defining non-namespaced macros, I agree with Dan here; since it's trivial to fix and they gave us a patch, I don't see a reason not to put it in.
Review of attachment 208358 [details] [review]: Emmanuele, any attribute can be encased in __ __, that works just fine. And I agree with Colin that there is no harm in taking this patch.
pushed