Browse Source

[build] Fix compiler warnings on some gcc versions

xfer_buffer() uses intf_get_dest_op() to obtain the destination
interface for xfer_deliver(), in order to check that this is the same
interface which provides xfer_buffer().  The return value from
intf_get_dest_op() (which contains the actual method implementing
xfer_deliver()) is not used.

On some gcc versions, this triggers a "value computed is not used"
warning, since the explicit type cast included within the
intf_get_dest_op() macro is treated as a "value computed".

Fix by explicitly casting the result of intf_get_dest_op() to void.

Reported-by: Matthew Helton <mwhelton@gmail.com>
Reported-by: James A. Peltier <jpeltier@sfu.ca>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 8 years ago
parent
commit
99d351605a
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      src/core/xferbuf.c

+ 1
- 1
src/core/xferbuf.c View File

@@ -309,7 +309,7 @@ struct xfer_buffer * xfer_buffer ( struct interface *intf ) {
309 309
 	/* Check that this operation is provided by the same interface
310 310
 	 * which handles xfer_deliver().
311 311
 	 */
312
-	intf_get_dest_op ( intf, xfer_deliver, &xfer_deliver_dest );
312
+	( void ) intf_get_dest_op ( intf, xfer_deliver, &xfer_deliver_dest );
313 313
 
314 314
 	if ( op && ( dest == xfer_deliver_dest ) ) {
315 315
 		xferbuf = op ( object );

Loading…
Cancel
Save