Is there a way to get gcc to detect duplicate characters in static libraries compared to the main code (or another static library?)
Here's the situation:
main.c mistakenly contains a function definition, for example. with signatureuint foohash(const char*)
foo.c also contains a function definition with a signature uint foohash(const char*)
foo.c and other source files are compiled into a static utility library with which the main program is associated, for example:
gcc -o main main.o util.o -L ./libs -lfooutils
So now main.o and libs / libfooutils.a contain the foohash function. Presumably, the linker found this symbol in main.o and did not look for it elsewhere.
Is there a way to get gcc to detect such a situation?
source
share