All of lore.kernel.org
 help / color / mirror / Atom feed
* multipath-tools: broken build system + warnings
@ 2018-03-07 16:40 Xose Vazquez Perez
  2018-03-07 21:16 ` Martin Wilck
  0 siblings, 1 reply; 4+ messages in thread
From: Xose Vazquez Perez @ 2018-03-07 16:40 UTC (permalink / raw)
  To: Christophe Varoqui, Benjamin Marzinski, Hannes Reinecke,
	Martin Wilck, Bart Van Assche, device-mapper development

Hi,

It has to type "make" *twice* to build the full
source code.


And new warnings:

==== 2 gcc warnings ===
make[1]: Entering directory '/home/xose/curre/arrays/multipath-tools/multipathd'

cc -O2 -g -pipe -Wall -Wextra -Wformat=2 -Werror=implicit-int -Werror=implicit-function-declaration -Werror=format-security -Wno-sign-compare -Wno-unused-parameter -Wno-clobbered -Werror=cast-qual
-Werror=discarded-qualifiers -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -DBIN_DIR=\"/sbin\" -DLIB_STRING=\"lib64\" -DRUN_DIR=\"run\" -MMD -MP  -fPIE -DPIE
-I../libmultipath -I../libmpathpersist -I../libmpathcmd -I../third-party -DUSE_SYSTEMD=234 -c -o uxlsnr.o uxlsnr.c
uxlsnr.c: In function ‘uxsock_cleanup’:
uxlsnr.c:151:16: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  int ux_sock = (int)arg;
                ^
In file included from ../libmultipath/debug.h:5:0,
                 from uxlsnr.c:28:
uxlsnr.c: In function ‘uxsock_listen’:
uxlsnr.c:184:39: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  pthread_cleanup_push(uxsock_cleanup, (void *)ux_sock);
                                       ^
==== end 2 gcc warnings ===



==== 2 clang warnings ===
make[1]: Entering directory '/home/xose/curre/arrays/multipath-tools/multipath'
clang -O2 -g -pipe -Wall -Wextra -Wformat=2 -Werror=implicit-int -Werror=implicit-function-declaration -Werror=format-security -Wno-sign-compare -Wno-unused-parameter -Wno-clobbered -Werror=cast-qual
-Werror=discarded-qualifiers -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -DBIN_DIR=\"/sbin\" -DLIB_STRING=\"lib64\" -DRUN_DIR=\"run\" -MMD -MP  -fPIE -DPIE
-I../libmultipath -I../libmpathcmd -c -o main.o main.c
main.c:628:11: warning: variable 'reply' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
        else if (p >= command + sizeof(command)) {
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:648:7: note: uninitialized use occurs here
        FREE(reply);
             ^~~~~
../libmultipath/memory.h:58:32: note: expanded from macro 'FREE'
#define FREE(p)      do { free(p); p = NULL; } while(0)
                               ^
main.c:628:7: note: remove the 'if' if its condition is always false
        else if (p >= command + sizeof(command)) {
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:609:32: note: initialize the variable 'reply' to silence this warning
        char command[1024], *p, *reply;
                                      ^
                                       = NULL

clang -O2 -g -pipe -Wall -Wextra -Wformat=2 -Werror=implicit-int -Werror=implicit-function-declaration -Werror=format-security -Wno-sign-compare -Wno-unused-parameter -Wno-clobbered -Werror=cast-qual
-Werror=discarded-qualifiers -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -DBIN_DIR=\"/sbin\" -DLIB_STRING=\"lib64\" -DRUN_DIR=\"run\" -MMD -MP  -fPIE -DPIE
-I../libmultipath -I../libmpathpersist -I../libmpathcmd -I../third-party -DUSE_SYSTEMD=234 -c -o uxlsnr.o uxlsnr.c
uxlsnr.c:184:39: warning: cast to 'void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast]
        pthread_cleanup_push(uxsock_cleanup, (void *)ux_sock);
                                             ^
==== end 2 clang warnings ===

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

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

* Re: multipath-tools: broken build system + warnings
  2018-03-07 16:40 multipath-tools: broken build system + warnings Xose Vazquez Perez
@ 2018-03-07 21:16 ` Martin Wilck
  2018-03-07 22:30   ` Xose Vazquez Perez
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Wilck @ 2018-03-07 21:16 UTC (permalink / raw)
  To: Xose Vazquez Perez, Christophe Varoqui, Benjamin Marzinski,
	Hannes Reinecke, Bart Van Assche, device-mapper development

On Wed, 2018-03-07 at 17:40 +0100, Xose Vazquez Perez wrote:
> Hi,
> 
> It has to type "make" *twice* to build the full
> source code.

Hm, strange. I need to double check. It doesn't happen with my tree
AFAICS.

> 
> And new warnings:
> 
> ==== 2 gcc warnings ===
> make[1]: Entering directory '/home/xose/curre/arrays/multipath-
> tools/multipathd'
> 
> cc -O2 -g -pipe -Wall -Wextra -Wformat=2 -Werror=implicit-int
> -Werror=implicit-function-declaration -Werror=format-security -Wno-
> sign-compare -Wno-unused-parameter -Wno-clobbered -Werror=cast-qual
> -Werror=discarded-qualifiers -Wp,-D_FORTIFY_SOURCE=2 -fstack-
> protector-strong --param=ssp-buffer-size=4 -DBIN_DIR=\"/sbin\"
> -DLIB_STRING=\"lib64\" -DRUN_DIR=\"run\" -MMD -MP  -fPIE -DPIE
> -I../libmultipath -I../libmpathpersist -I../libmpathcmd -I../third-
> party -DUSE_SYSTEMD=234 -c -o uxlsnr.o uxlsnr.c
> uxlsnr.c: In function ‘uxsock_cleanup’:
> uxlsnr.c:151:16: warning: cast from pointer to integer of different
> size [-Wpointer-to-int-cast]
>   int ux_sock = (int)arg;

This is fixed by my recent 

[PATCH] multipathd: fix -Wpointer-to-int-cast warning in uxlsnr

>                 ^
> In file included from ../libmultipath/debug.h:5:0,
>                  from uxlsnr.c:28:
> uxlsnr.c: In function ‘uxsock_listen’:
> uxlsnr.c:184:39: warning: cast to pointer from integer of different
> size [-Wint-to-pointer-cast]
>   pthread_cleanup_push(uxsock_cleanup, (void *)ux_sock);
>                                        ^
> ==== end 2 gcc warnings ===


> ==== 2 clang warnings ===
> make[1]: Entering directory '/home/xose/curre/arrays/multipath-
> tools/multipath'
> clang -O2 -g -pipe -Wall -Wextra -Wformat=2 -Werror=implicit-int
> -Werror=implicit-function-declaration -Werror=format-security -Wno-
> sign-compare -Wno-unused-parameter -Wno-clobbered -Werror=cast-qual
> -Werror=discarded-qualifiers -Wp,-D_FORTIFY_SOURCE=2 -fstack-
> protector-strong --param=ssp-buffer-size=4 -DBIN_DIR=\"/sbin\"
> -DLIB_STRING=\"lib64\" -DRUN_DIR=\"run\" -MMD -MP  -fPIE -DPIE
> -I../libmultipath -I../libmpathcmd -c -o main.o main.c
> main.c:628:11: warning: variable 'reply' is used uninitialized
> whenever 'if' condition is true [-Wsometimes-uninitialized]
>         else if (p >= command + sizeof(command)) {
>                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> main.c:648:7: note: uninitialized use occurs here
>         FREE(reply);
>              ^~~~~
> ../libmultipath/memory.h:58:32: note: expanded from macro 'FREE'
> #define FREE(p)      do { free(p); p = NULL; } while(0)
>                                ^
> main.c:628:7: note: remove the 'if' if its condition is always false
>         else if (p >= command + sizeof(command)) {
>              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> main.c:609:32: note: initialize the variable 'reply' to silence this
> warning
>         char command[1024], *p, *reply;
>                                       ^
>                                        = NULL
> 
> clang -O2 -g -pipe -Wall -Wextra -Wformat=2 -Werror=implicit-int
> -Werror=implicit-function-declaration -Werror=format-security -Wno-
> sign-compare -Wno-unused-parameter -Wno-clobbered -Werror=cast-qual
> -Werror=discarded-qualifiers -Wp,-D_FORTIFY_SOURCE=2 -fstack-
> protector-strong --param=ssp-buffer-size=4 -DBIN_DIR=\"/sbin\"
> -DLIB_STRING=\"lib64\" -DRUN_DIR=\"run\" -MMD -MP  -fPIE -DPIE
> -I../libmultipath -I../libmpathpersist -I../libmpathcmd -I../third-
> party -DUSE_SYSTEMD=234 -c -o uxlsnr.o uxlsnr.c
> uxlsnr.c:184:39: warning: cast to 'void *' from smaller integer type
> 'int' [-Wint-to-void-pointer-cast]
>         pthread_cleanup_push(uxsock_cleanup, (void *)ux_sock);
>                                              ^
> ==== end 2 clang warnings ===

Thanks for pointing this out. I'll send a fixup patch (setting reply =
NULL, as clang helpfully suggested).

Martin

-- 
Dr. Martin Wilck <mwilck@suse.com>, Tel. +49 (0)911 74053 2107
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

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

* Re: multipath-tools: broken build system + warnings
  2018-03-07 21:16 ` Martin Wilck
@ 2018-03-07 22:30   ` Xose Vazquez Perez
  2018-03-07 22:37     ` Martin Wilck
  0 siblings, 1 reply; 4+ messages in thread
From: Xose Vazquez Perez @ 2018-03-07 22:30 UTC (permalink / raw)
  To: Martin Wilck, Christophe Varoqui, Benjamin Marzinski,
	Hannes Reinecke, Bart Van Assche, device-mapper development

On 03/07/2018 10:16 PM, Martin Wilck wrote:

> On Wed, 2018-03-07 at 17:40 +0100, Xose Vazquez Perez wrote:
>> Hi,
>>
>> It has to type "make" *twice* to build the full
>> source code.
> 
> Hm, strange. I need to double check. It doesn't happen with my tree
> AFAICS.
These are removed by "make":
rm random.o weightedpath.o ontap.o hp_sw.o hds.o sysfs.o rdac.o const.o datacore.o emc.o iet.o
rm tur.o emc_clariion.o hp_sw.o rdac.o readsector0.o cciss_tur.o
rm nvme.o

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

* Re: multipath-tools: broken build system + warnings
  2018-03-07 22:30   ` Xose Vazquez Perez
@ 2018-03-07 22:37     ` Martin Wilck
  0 siblings, 0 replies; 4+ messages in thread
From: Martin Wilck @ 2018-03-07 22:37 UTC (permalink / raw)
  To: Xose Vazquez Perez, Christophe Varoqui, Benjamin Marzinski,
	Hannes Reinecke, Bart Van Assche, device-mapper development

On Wed, 2018-03-07 at 23:30 +0100, Xose Vazquez Perez wrote:
> On 03/07/2018 10:16 PM, Martin Wilck wrote:
> 
> > On Wed, 2018-03-07 at 17:40 +0100, Xose Vazquez Perez wrote:
> > > Hi,
> > > 
> > > It has to type "make" *twice* to build the full
> > > source code.
> > 
> > Hm, strange. I need to double check. It doesn't happen with my tree
> > AFAICS.
> 
> These are removed by "make":
> rm random.o weightedpath.o ontap.o hp_sw.o hds.o sysfs.o rdac.o
> const.o datacore.o emc.o iet.o
> rm tur.o emc_clariion.o hp_sw.o rdac.o readsector0.o cciss_tur.o
> rm nvme.o
> 

Yes. That used to be the case before too, but now, on second
invocation, "make" sees the generated dependency file and thus builds
again.

I have a fix for it. Will post soon.

Martin

-- 
Dr. Martin Wilck <mwilck@suse.com>, Tel. +49 (0)911 74053 2107
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

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

end of thread, other threads:[~2018-03-07 22:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-07 16:40 multipath-tools: broken build system + warnings Xose Vazquez Perez
2018-03-07 21:16 ` Martin Wilck
2018-03-07 22:30   ` Xose Vazquez Perez
2018-03-07 22:37     ` Martin Wilck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.