Add explicit void parameter in libspirv.h again (#2032)

When building C code with gcc and the
-Wstrict-prototypes option, function declarations
and definitions that don't specify their argument
types generate warnings.  Functions that don't
take parameters need to specify (void) as their
parameter list, rather than leaving it empty.

Note this only applies to C, so only the functions
exported in C-compatible headers need fixing.  In
C++ functions can't be declared/defined without a
parameter list, so C++ can safely allow an empty
parameter list to imply (void).
This commit is contained in:
James Jones 2018-11-06 08:12:26 -08:00 committed by Steven Perron
parent 60fac96c6b
commit 398f37a2e0
2 changed files with 2 additions and 2 deletions

View File

@ -498,7 +498,7 @@ SPIRV_TOOLS_EXPORT void spvValidatorOptionsSetSkipBlockLayout(
// Creates an optimizer options object with default options. Returns a valid
// options object. The object remains valid until it is passed into
// |spvOptimizerOptionsDestroy|.
SPIRV_TOOLS_EXPORT spv_optimizer_options spvOptimizerOptionsCreate();
SPIRV_TOOLS_EXPORT spv_optimizer_options spvOptimizerOptionsCreate(void);
// Destroys the given optimizer options object.
SPIRV_TOOLS_EXPORT void spvOptimizerOptionsDestroy(

View File

@ -17,7 +17,7 @@
#include "source/spirv_optimizer_options.h"
SPIRV_TOOLS_EXPORT spv_optimizer_options spvOptimizerOptionsCreate() {
SPIRV_TOOLS_EXPORT spv_optimizer_options spvOptimizerOptionsCreate(void) {
return new spv_optimizer_options_t();
}