orgcandman/Simple-Fuzzer — Issue #1: Build Failure Due to Implicit Declaration of memmem()
Author: soh-cah-toa
Created: 2012-01-22 18:46:35+00:00
State: open

Building sfuzz from the current HEAD (commit [6cc2924a13](https://github.com/orgcandman/Simple-Fuzzer/commit/6cc2924a13d6beca1f2d3e5ac8,33a3e3139cadd0)) causes the following error:

```
[CC] file-utils.o
file-utils.c: In function ‘add_symbol’:
file-utils.c:536:5: error: implicit declaration of function ‘memmem’ [-Werror=implicit-function-declaration]
file-utils.c:536:9: error: assignment makes pointer from integer without a cast [-Werror]
file-utils.c: In function ‘add_b_symbol’:
file-utils.c:596:13: error: assignment makes pointer from integer without a cast [-Werror]
cc1: all warnings being treated as errors

make: *** [file-utils.o] Error 1
```

Apparently, ```memmem()``` has not been declared but the ```#include ``` at line 33 would say otherwise. The manpage for ```memmem()``` demands that ```_GNU_SOURCE``` be defined before including ```string.h``` but that doesn't seem to help. Even if that were the case, it still doesn't make sense since ```_GNU_SOURCE``` is defined in the configure script at line 261.

Interestingly, the latest stable version, [0.6.3](http://aconole.brad-x.com/files/sfuzz-0.6-dist/sfuzz-0.6.3.tar.bz2), builds fine and is able to detect ```libdl.so``` yet the current HEAD does not. I'm not really sure if this is related or not.

This was on my Fedora 16 machine with GCC 4.6.2 20111027. Running ```uname -a``` for more system information displays:

```
Linux foobar 3.1.9-1.fc16.x86_64 #1 SMP Fri Jan 13 16:37:42 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
```