I get a strange linker error with the clang compiler version 3.2 on the
Debian build system: There is an "undefined reference" error even though
the function was previously defined in the same file. The code works
without any issues with the GNU toolchain.
Here is the error message:
rrep.o: In function `replace_string':
/«PKGBUILDDIR»/src/rrep.c:230: undefined reference to `write_replacement'
clang: error: linker command failed with exit code 1 (use -v to see
make: *** [rrep] Error 1
rrep.c has the following layout:
write_replacement (FILE *fp, const char *start, const regmatch_t *match,
const replace_t *replacement, const char *file_name,
if (write_replacement (out, start, match, replacement, file_name,
&pos) != SUCCESS)
The full log is at