public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* librdmacm in rdma-core build warnings
@ 2017-10-02  6:15 Leon Romanovsky
       [not found] ` <20171002061532.GJ2031-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Leon Romanovsky @ 2017-10-02  6:15 UTC (permalink / raw)
  To: Sean Hefty, Hal Rosenstock, Jason Gunthorpe; +Cc: RDMA mailing list

[-- Attachment #1: Type: text/plain, Size: 977 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: librdmacm in rdma-core build warnings
       [not found] ` <20171002061532.GJ2031-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
@ 2017-10-02 16:11   ` Hefty, Sean
       [not found]     ` <1828884A29C6694DAF28B7E6B8A82373AB199DAC-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Hefty, Sean @ 2017-10-02 16:11 UTC (permalink / raw)
  To: Leon Romanovsky, Hal Rosenstock, Jason Gunthorpe; +Cc: RDMA mailing list

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 619 bytes --]

> [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?

N‹§²æìr¸›yúèšØb²X¬¶Ç§vØ^–)Þº{.nÇ+‰·¥Š{±­ÙšŠ{ayº\x1dʇڙë,j\a­¢f£¢·hš‹»öì\x17/oSc¾™Ú³9˜uÀ¦æå‰È&jw¨®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿïêäz¹Þ–Šàþf£¢·hšˆ§~ˆmš

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: librdmacm in rdma-core build warnings
       [not found]     ` <1828884A29C6694DAF28B7E6B8A82373AB199DAC-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2017-10-02 17:54       ` Jason Gunthorpe
       [not found]         ` <20171002175431.GB13149-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Jason Gunthorpe @ 2017-10-02 17:54 UTC (permalink / raw)
  To: Hefty, Sean; +Cc: Leon Romanovsky, Hal Rosenstock, RDMA mailing list

On Mon, Oct 02, 2017 at 04:11:01PM +0000, Hefty, Sean wrote:
> > [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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: librdmacm in rdma-core build warnings
       [not found]         ` <20171002175431.GB13149-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
@ 2017-10-02 18:27           ` Leon Romanovsky
  0 siblings, 0 replies; 4+ messages in thread
From: Leon Romanovsky @ 2017-10-02 18:27 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: Hefty, Sean, Leon Romanovsky, Hal Rosenstock, RDMA mailing list

On Mon, Oct 2, 2017 at 8:54 PM, Jason Gunthorpe
<jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> wrote:
> On Mon, Oct 02, 2017 at 04:11:01PM +0000, Hefty, Sean wrote:
>> > [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.

Thanks Sean and Jason.

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

diff --git a/librdmacm/preload.c b/librdmacm/preload.c
index dfc23648..3ed0242e 100644
--- a/librdmacm/preload.c
+++ b/librdmacm/preload.c
@@ -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

>
> Jason
--
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] 4+ messages in thread

end of thread, other threads:[~2017-10-02 18:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-02  6:15 librdmacm in rdma-core build warnings Leon Romanovsky
     [not found] ` <20171002061532.GJ2031-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-10-02 16:11   ` Hefty, Sean
     [not found]     ` <1828884A29C6694DAF28B7E6B8A82373AB199DAC-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2017-10-02 17:54       ` Jason Gunthorpe
     [not found]         ` <20171002175431.GB13149-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-10-02 18:27           ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox