* some warnings seen while building librdmacm 1.0.16
@ 2012-10-29 12:09 Or Gerlitz
[not found] ` <508E71F4.8080205-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Or Gerlitz @ 2012-10-29 12:09 UTC (permalink / raw)
To: Hefty, Sean
Cc: linux-rdma (linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org)
Hi Sean,
FYI -- the below warnings seen while building librdmacm 1.0.16 with gcc
4.4.6 through rpmbuild
Or.
> make[1]: Entering directory `/root/rpmbuild/BUILD/librdmacm-1.0.16'
> CC src_librdmacm_la-cma.lo
> CC src_librdmacm_la-addrinfo.lo
> CC src_librdmacm_la-acm.lo
> CC src_librdmacm_la-rsocket.lo
> CC src_librdmacm_la-indexer.lo
> CC src_librspreload_la-preload.lo
> CC src_librspreload_la-indexer.lo
> CC cmatose.o
> CC common.o
> CC rping.o
> CC udaddy.o
> CC mckey.o
> CC rdma_client.o
> CC rdma_server.o
> CC rdma_xclient.o
> CC rdma_xserver.o
> CC rstream.o
> src/rsocket.c: In function 'rs_configure':
> src/rsocket.c:223: warning: ignoring return value of 'fscanf',
> declared with attribute warn_unused_result
> src/rsocket.c:228: warning: ignoring return value of 'fscanf',
> declared with attribute warn_unused_result
> src/rsocket.c:236: warning: ignoring return value of 'fscanf',
> declared with attribute warn_unused_result
> src/rsocket.c:241: warning: ignoring return value of 'fscanf',
> declared with attribute warn_unused_result
> src/rsocket.c:246: warning: ignoring return value of 'fscanf',
> declared with attribute warn_unused_result
> src/rsocket.c:254: warning: ignoring return value of 'fscanf',
> declared with attribute warn_unused_result
> examples/mckey.c: In function 'run':
> examples/mckey.c:473: warning: dereferencing pointer 'sib' does break
> strict-aliasing rules
> examples/mckey.c:471: note: initialized from here
> CC rcopy.o
> CCLD src/librdmacm.la
> CCLD src/librspreload.la
> CCLD examples/ucmatose
> CCLD examples/rping
> CCLD examples/udaddy
> CCLD examples/mckey
> CCLD examples/rdma_client
> CCLD examples/rdma_server
> CCLD examples/rdma_xclient
> CCLD examples/rstream
> CCLD examples/rdma_xserver
> CCLD examples/rcopy
> make[1]: Leaving directory `/root/rpmbuild/BUILD/librdmacm-1.0.16'
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: some warnings seen while building librdmacm 1.0.16
[not found] ` <508E71F4.8080205-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
@ 2012-11-05 20:06 ` Hefty, Sean
0 siblings, 0 replies; 2+ messages in thread
From: Hefty, Sean @ 2012-11-05 20:06 UTC (permalink / raw)
To: Or Gerlitz
Cc: linux-rdma (linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org)
I've added the following patch to eliminate the fscanf warnings:
rsocket: Remove fscanf build warnings
Cast fscanf return values to (void) to indicate that we don't
care if the call fails. In the case of a failure, we simply
fall back to using default values.
Problem reported by Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
diff --git a/src/rsocket.c b/src/rsocket.c
index 74dbcc7..58fcb8e 100644
--- a/src/rsocket.c
+++ b/src/rsocket.c
@@ -256,12 +256,12 @@ void rs_configure(void)
goto out;
if ((f = fopen(RS_CONF_DIR "/polling_time", "r"))) {
- fscanf(f, "%u", &polling_time);
+ (void) fscanf(f, "%u", &polling_time);
fclose(f);
}
if ((f = fopen(RS_CONF_DIR "/inline_default", "r"))) {
- fscanf(f, "%hu", &def_inline);
+ (void) fscanf(f, "%hu", &def_inline);
fclose(f);
if (def_inline < RS_MIN_INLINE)
@@ -269,17 +269,17 @@ void rs_configure(void)
}
if ((f = fopen(RS_CONF_DIR "/sqsize_default", "r"))) {
- fscanf(f, "%hu", &def_sqsize);
+ (void) fscanf(f, "%hu", &def_sqsize);
fclose(f);
}
if ((f = fopen(RS_CONF_DIR "/rqsize_default", "r"))) {
- fscanf(f, "%hu", &def_rqsize);
+ (void) fscanf(f, "%hu", &def_rqsize);
fclose(f);
}
if ((f = fopen(RS_CONF_DIR "/mem_default", "r"))) {
- fscanf(f, "%u", &def_mem);
+ (void) fscanf(f, "%u", &def_mem);
fclose(f);
if (def_mem < 1)
@@ -287,14 +287,14 @@ void rs_configure(void)
}
if ((f = fopen(RS_CONF_DIR "/wmem_default", "r"))) {
- fscanf(f, "%u", &def_wmem);
+ (void) fscanf(f, "%u", &def_wmem);
fclose(f);
if (def_wmem < RS_SNDLOWAT)
def_wmem = RS_SNDLOWAT << 1;
}
if ((f = fopen(RS_CONF_DIR "/iomap_size", "r"))) {
- fscanf(f, "%hu", &def_iomap_size);
+ (void) fscanf(f, "%hu", &def_iomap_size);
fclose(f);
/* round to supported values */
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-11-05 20:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-29 12:09 some warnings seen while building librdmacm 1.0.16 Or Gerlitz
[not found] ` <508E71F4.8080205-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-11-05 20:06 ` Hefty, Sean
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox