Skip to contentSkip to conversation

librdmacm in rdma-core build warnings

DISCUSSION Leon Romanovsky 3 participants 4 messages Oct 2, 2017 3 messages not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

Hi All,

After moving to gcc version 7.2.0 (GCC), I started experience the following compilation warning with default build.sh supplied with rdma-core.

[26/189] Building C object librdmacm/CMakeFiles/rspreload.dir/preload.c.o ../librdmacm/preload.c:818:9: warning: no previous prototype for ‘readv’ [-Wmissing-prototypes]
ssize_t readv(int socket, const struct iovec *iov, int iovcnt)

         ^~~~~

../librdmacm/preload.c:857:9: warning: no previous prototype for ‘writev’ [-Wmissing-prototypes]
ssize_t writev(int socket, const struct iovec *iov, int iovcnt)

The code to enable -Wmissing-prototypes checks is part of the rdma-core
for a year now, see commit: b192ed2347e5 ("Enable -Wmissing-prototypes/-Wmissing-declarations")

The fact that librdmacm/preload.c uses combination of RTLD_NEXT and dlsym to set readv/writev scares me to just delete readv and writev calls, because it is most probably wrong.

Any ideas how to fix it?

Thanks

#2 lore raw
In reply to a message not in the archive

PiBbMjYvMTg5XSBCdWlsZGluZyBDIG9iamVjdA0KPiBsaWJyZG1hY20vQ01ha2VGaWxlcy9yc3By ZWxvYWQuZGlyL3ByZWxvYWQuYy5vDQo+IC4uL2xpYnJkbWFjbS9wcmVsb2FkLmM6ODE4Ojk6IHdh cm5pbmc6IG5vIHByZXZpb3VzIHByb3RvdHlwZSBmb3INCj4g4oCYcmVhZHbigJkgWy1XbWlzc2lu Zy1wcm90b3R5cGVzXSAgc3NpemVfdCByZWFkdihpbnQgc29ja2V0LCBjb25zdCBzdHJ1Y3QNCj4g aW92ZWMgKmlvdiwgaW50IGlvdmNudCkNCj4gICAgICAgICAgXn5+fn4NCj4gLi4vbGlicmRtYWNt L3ByZWxvYWQuYzo4NTc6OTogd2FybmluZzogbm8gcHJldmlvdXMgcHJvdG90eXBlIGZvcg0KPiDi gJh3cml0ZXbigJkgWy1XbWlzc2luZy1wcm90b3R5cGVzXSAgc3NpemVfdCB3cml0ZXYoaW50IHNv Y2tldCwgY29uc3QNCj4gc3RydWN0IGlvdmVjICppb3YsIGludCBpb3ZjbnQpDQoNCkRvZXMgaW5j bHVkaW5nIHN5cy91aW8uaCBmaXggdGhpcz8NCg0K
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
In reply to a message not in the archive
Quoted 11 lines · Sean
Quoted 9 lines

[26/189] Building C object librdmacm/CMakeFiles/rspreload.dir/preload.c.o ../librdmacm/preload.c:818:9: warning: no previous prototype for ???readv??? [-Wmissing-prototypes] ssize_t readv(int socket, const struct iovec *iov, int iovcnt)

         ^~~~~

../librdmacm/preload.c:857:9: warning: no previous prototype for ???writev??? [-Wmissing-prototypes] ssize_t writev(int socket, const struct iovec *iov, int iovcnt)

Does including sys/uio.h fix this?

Something like that is the right solution, probably caused by glibc changes not gcc changes...

The prototype must come from glibc headers.

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw
In reply to a message not in the archive
Quoted 11 lines · Jason Gunthorpe
Quoted 10 lines · Sean
Quoted 9 lines

[26/189] Building C object librdmacm/CMakeFiles/rspreload.dir/preload.c.o ../librdmacm/preload.c:818:9: warning: no previous prototype for ???readv??? [-Wmissing-prototypes] ssize_t readv(int socket, const struct iovec *iov, int iovcnt)

         ^~~~~

../librdmacm/preload.c:857:9: warning: no previous prototype for ???writev??? [-Wmissing-prototypes] ssize_t writev(int socket, const struct iovec *iov, int iovcnt)

Quoted 6 lines
Quoted 1 line

Does including sys/uio.h fix this?

Something like that is the right solution, probably caused by glibc changes not gcc changes...

The prototype must come from glibc headers.

Thanks Sean and Jason.

It fixed the warnings, I'll send proper patch tomorrow once I'll be at the office.

librdmacm/preload.c +2 -0
index dfc23648..3ed0242e 100644
@@ -51,6 +51,8 @@
 #include <stdlib.h>
 #include <stdio.h>
 
+#include <sys/uio.h>
+
 #include <rdma/rdma_cma.h>
 #include <rdma/rdma_verbs.h>
 #include <rdma/rsocket.h>

Thanks

Quoted 2 lines

Jason

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html