flexdll
flexdll copied to clipboard
Add and fix C compiler warnings
I noticed that the CPPFLAGS and CFLAGS were not being passed when building Flexdll's C files, but they introduce problems when building OCaml 4.06 and 4.07 (explanation from David Allsopp):
- The underlying OCaml compiler is msvc64, unless
OCAML_PORTis set in AppVeyor matrix (so OCaml in the 4.06 and 4.07 tests is msvc64); - https://github.com/ocaml/ocaml/pull/1114 (4.06.0) introduced
CFLAGSandCPPFLAGSin the OCaml's installed Makefile.config; - FlexDLL's Makefile includes that
$(ocamlopt -where)/Makefile.configso ends up getting OCaml's msvc64CFLAGSandCPPFLAGSvalues; - https://github.com/ocaml/ocaml/pull/1840 (4.08.0) renamed them to
OC_CFLAGSandOC_CPPFLAGSwhich removes the problem.
I've instead chosen to add -Wall to enable warnings when compiling C files. To make sure new problems are not introduced, the warnings are turned into errors if and only if the CI environment variable matches [Tt]rue.
I've then tentatively fixed the warnings raised by GCC and MSVC.