1a4610269a Modules: Fix checks under -Werror=strict-prototypes Acked-by: Kitware Robot <[email protected]> Acked-by: buildbot <[email protected]> Merge-request: !9344
@@ -66,7 +66,7 @@ macro (CHECK_STRUCT_HAS_MEMBER _STRUCT _MEMBER _HEADER _RESULT)
set(_CHECK_STRUCT_MEMBER_SOURCE_CODE "
${_INCLUDE_FILES}
-int main()
+int main(void)
{
(void)sizeof(((${_STRUCT} *)0)->${_MEMBER});
return 0;
@@ -101,7 +101,7 @@ if(NOT DEFINED Iconv_IS_BUILT_IN)
"
#include <stddef.h>
#include <iconv.h>
- int main() {
+ int main(void) {
char *a, *b;
size_t i, j;
iconv_t ic;
@@ -72,7 +72,7 @@ be returned with OpenACC_<lang>_FLAGS.
set(OpenACC_C_CXX_TEST_SOURCE
-int main(){
+int main(void){
#ifdef _OPENACC
#else
@@ -102,7 +102,7 @@ const char accver_str[] = { 'I', 'N', 'F', 'O', ':', 'O', 'p', 'e', 'n', 'A',
('0' + ((_OPENACC/10)%10)),
('0' + ((_OPENACC/1)%10)),
']', '\\0' };
puts(accver_str);
@@ -210,8 +210,8 @@ endmacro()
# TODO: Install this macro separately?
macro(_check_c_compiler_attribute _ATTRIBUTE _RESULT)
- check_source_compiles(C "${_ATTRIBUTE} int somefunc() { return 0; }
- int main() { return somefunc();}" ${_RESULT}
+ check_source_compiles(C "${_ATTRIBUTE} int somefunc(void) { return 0; }
+ int main(void) { return somefunc();}" ${_RESULT}
)
endmacro()