This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: __attribute__((used)) provokes an error : 'used' attribute ignored
- From: Ian Lance Taylor <iant at google dot com>
- To: Drasko DRASKOVIC <drasko dot draskovic at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 28 Jul 2011 12:32:10 -0700
- Subject: Re: __attribute__((used)) provokes an error : 'used' attribute ignored
- References: <CAEk6gTBaqJ_Wk98KhJ=VVEpM+4Wb6kvEwZiacmy_1y9TeUUiHg@mail.gmail.com>
Drasko DRASKOVIC <drasko.draskovic@gmail.com> writes:
> I wanted to prevent compiler from optimizing out several variables of
> Linux kerenel, so I can debug it in GDB, so I used
> __attribute__((used)) following this philosophy :
> http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0491c/BABCJJID.html
>
> However, trying to compile my kernel, I am getting the error :
> arch/mips/mm/tlb-r4k.c:73: error: 'used' attribute ignored
>
> Why is this happening ?
>
> Compiler version :
> Target: mips-openwrt-linux-uclibc
> gcc version 4.3.3 (GCC)
Please show us the relevant code.
Ian