This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
Re: mbox compiler warning fix
- From: Jonathan Larmour <jifl at jifvik dot org>
- To: Andrew Lunn <andrew at lunn dot ch>
- Cc: eCos Patches <ecos-patches at ecos dot sourceware dot org>
- Date: Sun, 07 Jan 2007 18:18:37 +0000
- Subject: Re: mbox compiler warning fix
- References: <20070107171001.GD3369@lunn.ch>
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.
Jifl
------------------------------------------------------------------------
Index: kernel/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/kernel/current/ChangeLog,v
retrieving revision 1.139
diff -u -r1.139 ChangeLog
--- kernel/current/ChangeLog 12 Oct 2006 15:41:49 -0000 1.139
+++ kernel/current/ChangeLog 7 Jan 2007 17:08:13 -0000
@@ -1,3 +1,8 @@
+2007-01-07 Andrew Lunn <andrew.lunn@ascom.ch>
+
+ * src/sync/mbox.cxx (Cyg_Mbox::get): Fix compiler warning with gcc
+ version 4.1.2.
+
2006-10-12 Nick Garnett <nickg@ecoscentric.com>
* cdl/synch.cdl: Added CYGIMP_MBOX_USE_MBOXT_PLAIN option. This is
Index: kernel/current/src/sync/mbox.cxx
===================================================================
RCS file: /cvs/ecos/ecos/packages/kernel/current/src/sync/mbox.cxx,v
retrieving revision 1.7
diff -u -r1.7 mbox.cxx
--- kernel/current/src/sync/mbox.cxx 30 Jul 2005 11:58:25 -0000 1.7
+++ kernel/current/src/sync/mbox.cxx 7 Jan 2007 17:08:13 -0000
@@ -109,7 +109,7 @@
void *
Cyg_Mbox::get()
{
- void * p;
+ void * p=NULL;
if ( ! m.get( p ) )
return NULL;
return p;
@@ -119,7 +119,7 @@
void *
Cyg_Mbox::get( cyg_tick_count timeout )
{
- void * p;
+ void * p=NULL;
if ( ! m.get( p, timeout ) )
return NULL;
return p;
--
------["The best things in life aren't things."]------ Opinions==mine