This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: mbox compiler warning fix


On Sun, Jan 07, 2007 at 06:18:37PM +0000, Jonathan Larmour wrote:
> Andrew Lunn wrote:
> >Hi
> >
> >This patch fixes a compiler warnings in the mbox code with recent
> >versions of gcc.
> 
> We should avoid this for time-sensitive code. It should be tagged with 
> __attribute__((unused)) (aka CYGBLD_ATTRIB_UNUSED) instead. In fact all 
> uninitialised variable warnings should be treated this way.

Unfortunately, that does not work:

/home/lunn/eCos/anoncvs-clean/packages/kernel/current/src/sync/mbox.cxx: In member function 'void* Cyg_Mbox::get()':
/home/lunn/eCos/anoncvs-clean/packages/kernel/current/src/sync/mbox.cxx:113: warning: 'used' attribute ignored
/home/lunn/eCos/anoncvs-clean/packages/kernel/current/src/sync/mbox.cxx:113: warning: 'p' may be used uninitialized in this

when compiling:

void *
Cyg_Mbox::get()
{
  void * CYGBLD_ATTRIB_USED p;
    if ( ! m.get( p ) )
        return NULL;
    return p;
}

I also tried the CYGBLD_ATTRIB_USED in other positions on the line and
nothing works. 

Any ideas?

    Andrew


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]