Skip to content

Commit

Permalink
[build] Fix compiler warnings on some gcc versions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mcb30 committed Jul 27, 2015
1 parent 2b15ae5 commit 99d3516
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/xferbuf.c
Expand Up @@ -309,7 +309,7 @@ struct xfer_buffer * xfer_buffer ( struct interface *intf ) {
/* Check that this operation is provided by the same interface
* which handles xfer_deliver().
*/
intf_get_dest_op ( intf, xfer_deliver, &xfer_deliver_dest );
( void ) intf_get_dest_op ( intf, xfer_deliver, &xfer_deliver_dest );

if ( op && ( dest == xfer_deliver_dest ) ) {
xferbuf = op ( object );
Expand Down

0 comments on commit 99d3516

Please sign in to comment.