Apple's gcc can't handle deprecated attribute
Rainer Müller
raimue at macports.org
Thu Oct 4 09:57:20 PDT 2012
Hi,
On 2012-10-04 14:46, MK-MacPorts at techno.ms wrote:
> while trying to build a new port I ran into this compiler issue:
> ---
> :info:build ../inc/csvdb.h:163: error: wrong number of arguments specified for 'deprecated' attribute
> ---
>
> The corresponding line of code is this:
> ---
> void result_free(result_t *r) __attribute__ ((deprecated ("use csvdb_free_result")));
> ---
>
> Looks like i686-apple-darwin10-gcc-4.2.1 can't handle this for some reason.
This syntax is only supported as of gcc 4.5.0 [1,2].
> For now I've simply removed the whole attribute using a patch, but I wonder what would be a better way to deal with this...
If this is in an internal header, that's okay. If this header is
installed and meant to be included by third-party developers, then
change it to 'deprecated' without the message. This syntax should be
valid for gcc 4.2.1 [3]; hopefully even in the Apple patched version.
Rainer
[1] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36892
[2]
http://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/Function-Attributes.html#index-g_t_0040code_007bdeprecated_007d-attribute_002e-2345
[3]
http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/Function-Attributes.html#index-g_t_0040code_007bdeprecated_007d-attribute_002e-1849
More information about the macports-dev
mailing list