]> git.proxmox.com Git - mirror_ovs.git/commit - acinclude.m4
acinclude: Fix -Wstrict-prototypes and -Wold-style-definition detection.
authorBen Pfaff <blp@ovn.org>
Mon, 5 Dec 2016 22:29:35 +0000 (14:29 -0800)
committerBen Pfaff <blp@ovn.org>
Mon, 12 Dec 2016 22:34:17 +0000 (14:34 -0800)
commit37f4615e91bedc139f60cb2bb771327a39ed9d8d
tree8922d8e2159f5e1fc38817748e11411d06c16b13
parenta55dacac992730b951395fa7cf3cca31be5de8c4
acinclude: Fix -Wstrict-prototypes and -Wold-style-definition detection.

AC_LANG_PROGRAM(,) uses a program like this:

    int main() { return 0; }

but that triggers warnings for -Wstrict-prototypes and for
-Wold-style-definition, since this definition of main() lacks a prototype
and is therefore old-style.  This meant that -Wstrict-prototypes and
-Wold-style-definition weren't being turned on for new-enough GCC.  This
commit fixes the problem by changing the program that is test-compiled to:

    int x;

which doesn't make any compilers mad, as far as I know.

I recently upgraded to GCC 6.1 and just now noticed the issue, so I think
that GCC somewhere between version 4.9 and version 6.1 must have started
warning about main() when it's declared this way.

Also, fix a few functions that lacked prototypes.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
acinclude.m4
lib/perf-counter.c