Project

General

Profile

Bug #5456

Unknown attribute __unused__

Added by Gary Mills over 5 years ago. Updated over 5 years ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
lib - userland libraries
Start date:
2014-12-21
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

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

bzlib.diff (229 Bytes) bzlib.diff Gary Mills, 2014-12-21 01:55 AM

History

#1

Updated by Igor Kozhukhov over 5 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.

#2

Updated by Rich Lowe over 5 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.

#3

Updated by Gary Mills over 5 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.

#4

Updated by Rich Lowe over 5 years ago

  • Priority changed from Normal to Low
#5

Updated by Richard PALO over 5 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...

Also available in: Atom PDF