From: Michael Meffie Date: Thu, 15 Mar 2018 22:53:59 +0000 (-0400) Subject: roken: do not clobber __attribute__ X-Git-Tag: openafs-devel-1_9_0~487 X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=388eaec3452ed4b18a95ee34efcbe4cf64814701;hp=1711917e7ded7ebebae74d7bfeb8359a69db8869 roken: do not clobber __attribute__ The roken-common.h header defines an empty macro called __attribute__ when HAVE___ATTRIBUTE__ is not defined. This macro conditionally removes the `format' function attributes in the roken headers at compile time. Unfortunately, the empty __attribute__ macro will also clobber other attribute types encountered after the roken.h header inclusion. This is not an issue when building under gcc or clang, since the empty attribute macro will not be defined. However Solaris Studio supports a subset of the function attribute types, with `format' not currently supported. This means roken will define an empty __attribute__ macro, which prevents the use of other attribute types. This commit does not change the roken files directly because they are external. Instead, the processing of the roken.h.in file has been updated to undefine the __attribute__ macro at the end of the generated roken.h header. Change-Id: Iea5622ae175e7f82a60780838948178bd7f8b56f Reviewed-on: https://gerrit.openafs.org/12961 Reviewed-by: Andrew Deason Reviewed-by: Benjamin Kaduk Tested-by: BuildBot --- diff --git a/src/roken/Makefile.in b/src/roken/Makefile.in index 873746b..69b16c5 100644 --- a/src/roken/Makefile.in +++ b/src/roken/Makefile.in @@ -43,7 +43,7 @@ dest: librokenafs.la librokenafs.a clean: $(LT_CLEAN) - $(RM) -f $(OBJECTS) librokenafs.a err.h + $(RM) -f $(OBJECTS) librokenafs.a err.h roken.h $(TOP_LIBDIR)/librokenafs.$(SHLIB_SUFFIX): librokenafs.la $(LT_INSTALL_DATA) librokenafs.la $(TOP_LIBDIR)/librokenafs.la @@ -65,7 +65,7 @@ $(TOP_INCDIR)/base64.h: ${UPSTREAM}/base64.h $(TOP_INCDIR)/err.h: ${UPSTREAM}/err.hin $(INSTALL_DATA) $? $@ -$(TOP_INCDIR)/roken.h: $(UPSTREAM)/roken.h.in +$(TOP_INCDIR)/roken.h: roken.h $(INSTALL_DATA) $? $@ $(TOP_INCDIR)/roken-common.h: $(UPSTREAM)/roken-common.h @@ -74,6 +74,9 @@ $(TOP_INCDIR)/roken-common.h: $(UPSTREAM)/roken-common.h err.h: ${UPSTREAM}/err.hin $(INSTALL_DATA) $? $@ +roken.h: $(UPSTREAM)/roken.h.in roken-post.h + cat $(UPSTREAM)/roken.h.in roken-post.h >$@ + # Here we have explicit rules for all the libtool objects we might need to # build. The implicit rules don't work since the sources are in a different # castle. diff --git a/src/roken/roken-post.h b/src/roken/roken-post.h new file mode 100644 index 0000000..076eed3 --- /dev/null +++ b/src/roken/roken-post.h @@ -0,0 +1,8 @@ +/* + * roken defines an empty __attribute__() macro when the format + * attribute is not available. Undefine this empty __attribute__() macro + * to to allow other types of attributes in code which includes roken.h. + */ +#ifdef __attribute__ +#undef __attribute__ +#endif