configure: add macro to check compiler flag '-Wstrict-prototype'
commit30e1fad92675be833e6c3f61e3191b393da3b7e7
authorChristophe CURIS <christophe.curis@free.fr>
Mon, 8 Dec 2014 21:42:23 +0000 (8 22:42 +0100)
committerCarlos R. Mafra <crmafra@gmail.com>
Wed, 10 Dec 2014 10:19:18 +0000 (10 10:19 +0000)
treed97d5f3f64cd2e3dd4ff61417abfb6ecbe2d6db7
parent11fe8bd860af5a113af42d20caac525285cbf9a9
configure: add macro to check compiler flag '-Wstrict-prototype'

Strict prototype are better for portability and to avoid bugs because it
makes sure the compiler has the information to properly validate the
arguments given when a function is called.

This flag however need special care when checking for it, because the
declaration for 'main' generated by autoconf cannot be a strict prototype
so the detection would always see the flag as failing.

This patch handles this by creating a dedicated macro for this detection
which uses a good prototype because we're in a case where it is possible,
so the detection will not always fail; it also makes sure to add the flag
to CFLAG only at the end, to avoid falsely crashing any further test done
in the configure script.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
configure.ac
m4/wm_cflags_check.m4