RE: [PATCH] eliminate compiler warning for xpc_channel.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Placate a compiler warning that 'msg' may be used uninitialized in
> function xpc_initiate_allocate().

Which version of which compiler ... at first glance the code looks
trivially OK (&msg is passed to xpc_allocate_msg() before it is used).
On closer inspection I assume that the compiler must have inlined
xpc_allocate_msg() in order to detect this, and there are four "return"
statements in there that can return w/o doing the initialization. So
the warning is real, and we are not just "placating" the compiler.

-	struct xpc_msg *msg;
+	struct xpc_msg *msg = msg;

Did you mean to say "*msg = NULL"?

-Tony
-
: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Sparc Linux]     [DCCP]     [Linux ARM]     [Yosemite News]     [Linux SCSI]     [Linux x86_64]     [Linux for Ham Radio]

  Powered by Linux