mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-03 13:18:37 -06:00
Modules: Fix checks under -Werror=strict-prototypes
This fixes configuration checks when using -Werror=strict-prototypes or -Wstrict-prototypes compiler flag, for example, via the CMAKE_C_FLAGS.
This commit is contained in:
@@ -66,7 +66,7 @@ macro (CHECK_STRUCT_HAS_MEMBER _STRUCT _MEMBER _HEADER _RESULT)
|
|||||||
|
|
||||||
set(_CHECK_STRUCT_MEMBER_SOURCE_CODE "
|
set(_CHECK_STRUCT_MEMBER_SOURCE_CODE "
|
||||||
${_INCLUDE_FILES}
|
${_INCLUDE_FILES}
|
||||||
int main()
|
int main(void)
|
||||||
{
|
{
|
||||||
(void)sizeof(((${_STRUCT} *)0)->${_MEMBER});
|
(void)sizeof(((${_STRUCT} *)0)->${_MEMBER});
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ if(NOT DEFINED Iconv_IS_BUILT_IN)
|
|||||||
"
|
"
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <iconv.h>
|
#include <iconv.h>
|
||||||
int main() {
|
int main(void) {
|
||||||
char *a, *b;
|
char *a, *b;
|
||||||
size_t i, j;
|
size_t i, j;
|
||||||
iconv_t ic;
|
iconv_t ic;
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ be returned with OpenACC_<lang>_FLAGS.
|
|||||||
|
|
||||||
set(OpenACC_C_CXX_TEST_SOURCE
|
set(OpenACC_C_CXX_TEST_SOURCE
|
||||||
"
|
"
|
||||||
int main(){
|
int main(void){
|
||||||
#ifdef _OPENACC
|
#ifdef _OPENACC
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
@@ -102,7 +102,7 @@ const char accver_str[] = { 'I', 'N', 'F', 'O', ':', 'O', 'p', 'e', 'n', 'A',
|
|||||||
('0' + ((_OPENACC/10)%10)),
|
('0' + ((_OPENACC/10)%10)),
|
||||||
('0' + ((_OPENACC/1)%10)),
|
('0' + ((_OPENACC/1)%10)),
|
||||||
']', '\\0' };
|
']', '\\0' };
|
||||||
int main()
|
int main(void)
|
||||||
{
|
{
|
||||||
puts(accver_str);
|
puts(accver_str);
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -210,8 +210,8 @@ endmacro()
|
|||||||
|
|
||||||
# TODO: Install this macro separately?
|
# TODO: Install this macro separately?
|
||||||
macro(_check_c_compiler_attribute _ATTRIBUTE _RESULT)
|
macro(_check_c_compiler_attribute _ATTRIBUTE _RESULT)
|
||||||
check_source_compiles(C "${_ATTRIBUTE} int somefunc() { return 0; }
|
check_source_compiles(C "${_ATTRIBUTE} int somefunc(void) { return 0; }
|
||||||
int main() { return somefunc();}" ${_RESULT}
|
int main(void) { return somefunc();}" ${_RESULT}
|
||||||
)
|
)
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user