mirror of
https://gitlab.com/ita1024/waf.git
synced 2025-01-11 19:05:04 +01:00
c_config: Avoid warnings/errors when checking for C functions
The check for C functions fails with '-Werror' in GCC (5.2). return (int)p; ^ The cast here triggers this error: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] p=(void*)(%s); ^ This conversion triggers another error with '-pedantic -Werror': error: ISO C forbids conversion of function pointer to object pointer type [-Werror=pedantic] This patch fixes both errors. Signed-off-by: Mohammad Alsaleh <CE.Mohammad.AlSaleh@gmail.com>
This commit is contained in:
parent
c5952e19ab
commit
6de1ac07d5
@ -25,10 +25,10 @@ cfg_ver = {
|
||||
|
||||
SNIP_FUNCTION = '''
|
||||
int main(int argc, char **argv) {
|
||||
void *p;
|
||||
void (*p)();
|
||||
(void)argc; (void)argv;
|
||||
p=(void*)(%s);
|
||||
return (int)p;
|
||||
p=(void(*)())(%s);
|
||||
return !p;
|
||||
}
|
||||
'''
|
||||
"""Code template for checking for functions"""
|
||||
|
Loading…
Reference in New Issue
Block a user