Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I get the following error while executing make tooldir=/usr

../../binutils-2.22/libiberty/regex.c:130:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
../../binutils-2.22/libiberty/regex.c:130:7: warning: conflicting types for built-in function 'malloc' [enabled by default]
../../binutils-2.22/libiberty/regex.c:131:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
../../binutils-2.22/libiberty/regex.c:131:7: warning: conflicting types for built-in function 'realloc' [enabled by default]
In file included from /usr/include/bits/string2.h:1296:0,
             from /usr/include/string.h:633,
             from ../../binutils-2.22/libiberty/regex.c:149:
/usr/include/stdlib.h:470:14: error: conflicting types for 'malloc'
../../binutils-2.22/libiberty/regex.c:130:7: note: previous declaration of 'malloc' was here
In file included from ../../binutils-2.22/libiberty/regex.c:638:0:
../../binutils-2.22/libiberty/regex.c: In function 'byte_regex_compile':
../../binutils-2.22/libiberty/regex.c:2439:7: warning: implicit declaration of function 'free' [-Wimplicit-function-declaration]
../../binutils-2.22/libiberty/regex.c:2439:33: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
../../binutils-2.22/libiberty/regex.c:2500:17: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
../../binutils-2.22/libiberty/regex.c:2533:36: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
../../binutils-2.22/libiberty/regex.c:2640:28: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
../../binutils-2.22/libiberty/regex.c:3643:26: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
../../binutils-2.22/libiberty/regex.c:4150:5: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
../../binutils-2.22/libiberty/regex.c: In function 'byte_re_compile_fastmap':
../../binutils-2.22/libiberty/regex.c:4835:11: warning: implicit declaration of function 'abort' [-Wimplicit-function-declaration]
../../binutils-2.22/libiberty/regex.c:4835:11: warning: incompatible implicit declaration of built-in function 'abort' [enabled by default]
../../binutils-2.22/libiberty/regex.c: In function 'byte_re_match_2_internal':
../../binutils-2.22/libiberty/regex.c:7424:11: warning: incompatible implicit declaration of built-in function 'abort' [enabled by default]
../../binutils-2.22/libiberty/regex.c: In function 'xregcomp':
../../binutils-2.22/libiberty/regex.c:7978:4: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
../../binutils-2.22/libiberty/regex.c: In function 'xregexec':
../../binutils-2.22/libiberty/regex.c:8053:7: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
../../binutils-2.22/libiberty/regex.c: In function 'xregerror':
../../binutils-2.22/libiberty/regex.c:8081:5: warning: incompatible implicit declaration of built-in function 'abort' [enabled by default]
../../binutils-2.22/libiberty/regex.c: In function 'xregfree':
../../binutils-2.22/libiberty/regex.c:8114:3: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
make[2]: *** [regex.o] Error 1
make[2]: Leaving directory `/sources/binutils-build/libiberty'
make[1]: *** [all-libiberty] Error 2
make[1]: Leaving directory `/sources/binutils-build'
make: *** [all] Error 2

The complete output is here, and the page I was using is here

Can anyone help me?

EDIT:

/usr/include/stdlib.h (line 470)

extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;

binutils-2.22/libiberty/regex.c (line 130)

char *malloc ();
share|improve this question
    
Could you give the declarations of malloc in files /usr/include/stdlib.h (line 470) and binutils-2.22/libiberty/regex.c (line 130) – Philippe Blayo Dec 20 '12 at 11:04
    
What CFLAGS are you using to compile? – Mat Dec 20 '12 at 15:34
    
The default ones. I havent added anything – Ruben Roy Dec 21 '12 at 13:40
    
And I am compiling on ubuntu 10.04 64bit – Ruben Roy Dec 21 '12 at 13:41
2  
you should run configure before make. I also saw you don't include /usr/include at line 540. – user55518 Mar 24 '14 at 15:22

The problem is that STDC_HEADERS is not defined when you are compiling the code. See line 47 of that version of regex.c. This probably happened because you didn't run configure or you did but something went wrong.

If you hadn't run configure, just go ahead and run it:

./configure   

If you do run it, it should generate a file called config.h which should use #define to define the macro STDC_HEADERS to some value. If not, it's possible that the compiler you are using is missing something it depends on (such as system header files) or is misconfigured or incorrectly installed.

As I mentioned in a comment above though, the release of binutils you're using is over 4 years old now and you should use a newer version I think.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.