[libvirt] [PATCH] virsh: ignore readline -Wstrict-prototypes warning

Ján Tomko jtomko at redhat.com
Wed May 31 14:59:14 UTC 2017


On Fri, May 26, 2017 at 09:49:15PM +0400, Roman Bogorodskiy wrote:
>When building with clang 4.0.0, virsh build fails like this:
>
>gmake[3]: Entering directory '/usr/home/novel/code/libvirt/tools'
>  CC       virsh-virsh.o
>In file included from virsh.c:45:
>In file included from /usr/local/include/readline/readline.h:31:
>/usr/local/include/readline/rltypedefs.h:35:22: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
>typedef int Function () __attribute__ ((deprecated));
>                     ^
>                      void
>/usr/local/include/readline/rltypedefs.h:36:24: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
>typedef void VFunction () __attribute__ ((deprecated));
>                       ^
>                        void
>/usr/local/include/readline/rltypedefs.h:37:26: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
>typedef char *CPFunction () __attribute__ ((deprecated));
>                         ^
>                          void
>/usr/local/include/readline/rltypedefs.h:38:28: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
>typedef char **CPPFunction () __attribute__ ((deprecated));
>                           ^
>                            void
>In file included from virsh.c:45:
>/usr/local/include/readline/readline.h:385:23: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
>extern int rl_message ();
>                      ^
>                       void
>5 errors generated.
>gmake[3]: *** [Makefile:2823: virsh-virsh.o] Error 1
>
>Fix that by adding VIR_WARNINGS_NO_STRICT_PROTOTYPES macro that uses
>"GCC diagnostic push" to ignore -Wstrict-prototypes and wrapping
>readline includes with it and VIR_WARNINGS_RESET.
>
>Bug report on the readline mailing list:
>
> http://lists.gnu.org/archive/html/bug-readline/2017-05/msg00004.html
>---
> src/internal.h     | 4 ++++
> tools/virsh.c      | 2 ++
> tools/virt-admin.c | 2 ++
> 3 files changed, 8 insertions(+)
>

ACK

Jan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170531/29e1b538/attachment-0001.sig>


More information about the libvir-list mailing list