Avoid superfluous compiler warnings

GCC warns about uninitialized local variables in cases where no
initialization is needed, in particular in the overloads of the
'Capability::call()' function. Prior this patch, we dealt with those
warnings by using an (unreliable) GCC pragma or by disabling the
particular warning altogether (which is a bad idea). This patch removes
the superfluous warnings by telling the compiler that the variable in
question is volatile.
This commit is contained in:
Norman Feske
2012-10-05 15:42:32 +02:00
parent f4bc08c16f
commit 64245dde3a
5 changed files with 46 additions and 55 deletions

View File

@ -151,7 +151,7 @@ void Ipc_server::_prepare_next_reply_wait()
_read_offset = sizeof(long);
/* read client thread id from request buffer */
long tid;
long tid = 0;
if (_reply_needed) {
_read_from_buf(tid);
Ipc_ostream::_dst = Native_capability(tid, 0); /* only _tid member is used */