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:
Mohammad Alsaleh 2015-09-08 18:11:05 +03:00 committed by Thomas Nagy
parent c5952e19ab
commit 6de1ac07d5
1 changed files with 3 additions and 3 deletions

View File

@ -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"""