[Libguestfs] [PATCH libnbd v2 2/3] copy: Do not use trim for zeroing
Nir Soffer
nirsof at gmail.com
Mon Feb 22 20:01:02 UTC 2021
On Mon, Feb 22, 2021 at 9:44 PM Richard W.M. Jones <rjones at redhat.com> wrote:
>
> This one still fails with:
>
> gcc -DHAVE_CONFIG_H -I. -I.. -I../include -I../common/include -I../common/utils -Wall -Wvla -Werror -pthread -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -O3 -mavx2 -MT nbdcopy-pipe-ops.o -MD -MP -MF .deps/nbdcopy-pipe-ops.Tpo -c -o nbdcopy-pipe-ops.o `test -f 'pipe-ops.c' || echo './'`pipe-ops.c
> pipe-ops.c:177:17: error: initialization of ‘_Bool (*)(struct rw *, uint64_t, uint64_t, _Bool)’ {aka ‘_Bool (*)(struct rw *, long unsigned int, long unsigned int, _Bool)’} from incompatible pointer type ‘_Bool (*)(struct rw *, uint64_t, uint64_t)’ {aka ‘_Bool (*)(struct rw *, long unsigned int, long unsigned int)’} [-Werror=incompatible-pointer-types]
> 177 | .synch_zero = pipe_synch_trim_zero,
> | ^~~~~~~~~~~~~~~~~~~~
> pipe-ops.c:177:17: note: (near initialization for ‘pipe_ops.synch_zero’)
> pipe-ops.c:189:18: error: initialization of ‘_Bool (*)(struct rw *, struct command *, nbd_completion_callback, _Bool)’ from incompatible pointer type ‘_Bool (*)(struct rw *, struct command *, nbd_completion_callback)’ [-Werror=incompatible-pointer-types]
> 189 | .asynch_zero = pipe_asynch_trim_zero,
> | ^~~~~~~~~~~~~~~~~~~~~
> pipe-ops.c:189:18: note: (near initialization for ‘pipe_ops.asynch_zero’)
> cc1: all warnings being treated as errors
>
> Did you post the wrong version of this patch? I notice it still has
> the *_trim methods.
I planned to remove the trim methods later, but looks like it is better to
remove them before this patch. Will send v3 soon.
More information about the Libguestfs
mailing list