Bug #5456
openUnknown attribute __unused__
0%
Description
A build with the Studio 12.2 produces this error:
"../../../common/bzip2/compress.c", line 244: attribute "__unused__" is unknown, ignored (E_ATTRIBUTE_UNKNOWN)
cc: acomp failed for ../../../common/bzip2/compress.c
...
dmake: Warning: Command failed for target `obj64/bz2compress.o'
The solution is to patch bzlib_private.h, in usr/src/common/bzip2, to define unused to null for a non-gcc compiler. I'm attaching the patch file.
Files
Updated by Igor Kozhukhov over 8 years ago
we have defined macro in file uts/common/sys/ccompile.h
#define __GNU_UNUSED __attribute__((__unused__))
need update it for visibility only for GCC build with defined GNUC
and provide definition for Studio build like:
#define __GNU_UNUSED
also if you try take a look Studio build you need check lint warnings and hide/fix it.
Updated by Rich Lowe over 8 years ago
Yeah, nothing should be using the attribute directly, everyone should be using __GNU_UNUSED.
If something is using attribute((unused)) directly, it should be fixed to use __GNU_UNUSED.
Updated by Gary Mills over 8 years ago
Here's a bit of the source for common/bzip2/compress.c:
239 static
240 void sendMTFValues ( EState* s )
241 {
242 Int32 v, t, i, j, gs, ge, totc, bt, bc, iter;
243 Int32 nSelectors, alphaSize, minLen, maxLen, selCtr;
-------------------------------------------------------------------------------
244 Int32 nGroups, __GNU_UNUSED nBytes;
-------------------------------------------------------------------------------
245
So it is specifying that macro correctly. It even includes sys/ccompile.h . So I suppose it's that header file that needs fixing.
Updated by Richard PALO over 8 years ago
I tried building this snippet with studio 12.1 and it success without warning, so this seems related to the fact
that a more recent release such as 12.[234] was used...