Bug#844831: crash: FTBFS: stdlib.h:427:14: error: conflicting types for 'malloc'

2016-12-05 Thread Juerg Haefliger
> > gcc -c -DHAVE_CONFIG_H -g -O2 -fdebug-prefix-map=/<>=.
-specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat
-Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -I. -I./../include  -W 
-Wall -Wwrite-strings
-Wc++-compat -Wstrict-prototypes -pedantic  ./regex.c -o regex.o
> > ./regex.c:132:1: warning: function declaration isn't a prototype 
> > [-Wstrict-prototypes]
> >  char *malloc ();
> >  ^~~~
> > ./regex.c:132:7: warning: conflicting types for built-in function 'malloc'
> >  char *malloc ();

This is caused by the '-pie' option in debian/rules:
export DEB_BUILD_MAINT_OPTIONS=hardening=+all,-pie

The above adds the option '-specs=/usr/share/dpkg/no-pie-compile.specs' to 
CFLAGS which seems to
cause problems with gcc6.

Removing '-pie' from DEB_BUILD_MAINT_OPTIONS fixes the compilation error but 
I'm not sure if that's
the real fix. Maybe there's an issue with the content of 
/usr/share/dpkg/no-pie-compile.specs.

...Juerg



signature.asc
Description: OpenPGP digital signature


Bug#844831: crash: FTBFS: stdlib.h:427:14: error: conflicting types for 'malloc'

2016-11-18 Thread Lucas Nussbaum
Source: crash
Version: 7.1.5-4
Severity: serious
Tags: stretch sid
User: debian...@lists.debian.org
Usertags: qa-ftbfs-20161118 qa-ftbfs
Justification: FTBFS on amd64

Hi,

During a rebuild of all packages in sid, your package failed to build on
amd64.

Relevant part (hopefully):
> gcc -c -DHAVE_CONFIG_H -g -O2 -fdebug-prefix-map=/<>=. 
> -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat 
> -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -I. -I./../include  
> -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic  
> ./regex.c -o regex.o
> ./regex.c:132:1: warning: function declaration isn't a prototype 
> [-Wstrict-prototypes]
>  char *malloc ();
>  ^~~~
> ./regex.c:132:7: warning: conflicting types for built-in function 'malloc'
>  char *malloc ();
>^~
> ./regex.c:133:1: warning: function declaration isn't a prototype 
> [-Wstrict-prototypes]
>  char *realloc ();
>  ^~~~
> ./regex.c:133:7: warning: conflicting types for built-in function 'realloc'
>  char *realloc ();
>^~~
> In file included from /usr/include/x86_64-linux-gnu/bits/string2.h:319:0,
>  from /usr/include/string.h:630,
>  from ./regex.c:151:
> /usr/include/stdlib.h:427:14: error: conflicting types for 'malloc'
>  extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
>   ^~
> ./regex.c:132:7: note: previous declaration of 'malloc' was here
>  char *malloc ();
>^~
> In file included from ./regex.c:640:0:
> ./regex.c: In function 'byte_regex_compile':
> ./regex.c:2280:11: warning: implicit declaration of function 'free' 
> [-Wimplicit-function-declaration]
>return (free (compile_stack.stack), value)
>^
> ./regex.c:2441:33: note: in expansion of macro 'FREE_STACK_RETURN'
>if (!COMPILED_BUFFER_VAR) FREE_STACK_RETURN (REG_ESPACE);
>  ^
> ./regex.c:2280:11: warning: incompatible implicit declaration of built-in 
> function 'free'
>return (free (compile_stack.stack), value)
>^
> ./regex.c:2441:33: note: in expansion of macro 'FREE_STACK_RETURN'
>if (!COMPILED_BUFFER_VAR) FREE_STACK_RETURN (REG_ESPACE);
>  ^
> ./regex.c:2280:11: note: include '' or provide a declaration of 
> 'free'
>return (free (compile_stack.stack), value)
>^
> ./regex.c:2441:33: note: in expansion of macro 'FREE_STACK_RETURN'
>if (!COMPILED_BUFFER_VAR) FREE_STACK_RETURN (REG_ESPACE);
>  ^
> ./regex.c:2280:11: warning: incompatible implicit declaration of built-in 
> function 'free'
>return (free (compile_stack.stack), value)
>^
> ./regex.c:2502:17: note: in expansion of macro 'FREE_STACK_RETURN'
>  FREE_STACK_RETURN (REG_BADRPT);
>  ^
> ./regex.c:2280:11: note: include '' or provide a declaration of 
> 'free'
>return (free (compile_stack.stack), value)
>^
> ./regex.c:2502:17: note: in expansion of macro 'FREE_STACK_RETURN'
>  FREE_STACK_RETURN (REG_BADRPT);
>  ^
> ./regex.c:2280:11: warning: incompatible implicit declaration of built-in 
> function 'free'
>return (free (compile_stack.stack), value)
>^
> ./regex.c:2535:36: note: in expansion of macro 'FREE_STACK_RETURN'
>  if (p == pend) FREE_STACK_RETURN (REG_EESCAPE);
> ^
> ./regex.c:2280:11: note: include '' or provide a declaration of 
> 'free'
>return (free (compile_stack.stack), value)
>^
> ./regex.c:2535:36: note: in expansion of macro 'FREE_STACK_RETURN'
>  if (p == pend) FREE_STACK_RETURN (REG_EESCAPE);
> ^
> ./regex.c:2280:11: warning: incompatible implicit declaration of built-in 
> function 'free'
>return (free (compile_stack.stack), value)
>^
> ./regex.c:2642:28: note: in expansion of macro 'FREE_STACK_RETURN'
>  if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
> ^
> ./regex.c:2280:11: note: include '' or provide a declaration of 
> 'free'
>return (free (compile_stack.stack), value)
>^
> ./regex.c:2642:28: note: in expansion of macro 'FREE_STACK_RETURN'
>  if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
> ^
> ./regex.c:154:47: warning: right-hand operand of comma expression has no 
> effect [-Wunused-value]
>  #  define bzero(s, n) (memset (s, '\0', n), (s))
>^~
> ./regex.c:3126:13: note: in expansion of macro 'bzero'
>  bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH);
>  ^
> In file included from ./regex.c:640:0:
> ./regex.c:2280:11: warning: