[Debian-med-packaging] Help in gcc-5 migration needed

Sven Joachim svenjoac at gmx.de
Sat Jun 27 08:08:57 UTC 2015


On 2015-06-27 07:48 +0200, Andreas Tille wrote:

> Hi,
>
> any idea how to deal with this kind of errors?  I noticed that this
> problem also occures when velvet is built with clang but have no idea
> how to fix it.
>
>> Package: src:velvet
>> Version: 1.2.10+dfsg1-1
>> ...
>> 
>> gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security
>> -fopenmp -O3 -D MAXKMERLENGTH=31 -D CATEGORIES=2 -D LONGSEQUENCES -c
>> src/autoOpen.c -o obj/autoOpen.o
>> gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security
>> -fopenmp -O3 -Wl,-z,relro -o velveth obj/tightString.o obj/run.o
>> obj/recycleBin.o obj/splay.o obj/splayTable.o obj/readSet.o
>> obj/binarySequences.o obj/utility.o obj/kmer.o
>> obj/kmerOccurenceTable.o obj/autoOpen.o -lz -lm
>> obj/run.o: In function `main':
>> /??BUILDDIR??/velvet-1.2.10+dfsg1/src/run.c:245: undefined reference to `isCreateBinary'
>> /??BUILDDIR??/velvet-1.2.10+dfsg1/src/run.c:291: undefined reference to `isCreateBinary'
>> obj/splayTable.o: In function `inputSequenceArrayIntoSplayTableAndArchive':
>> /??BUILDDIR??/velvet-1.2.10+dfsg1/src/splayTable.c:982: undefined reference to `isCreateBinary'
>> collect2: error: ld returned 1 exit status
>> make[2]: *** [velveth] Error 1

The following warning from clang appeared before that:

,----
| In file included from src/run.c:31:
| In file included from src/run.h:30:
| src/readSet.h:64:16: warning: inline function 'isCreateBinary' is not defined [-Wundefined-inline]
| inline boolean isCreateBinary();
|                ^
| src/run.c:245:7: note: used here
|                 if (isCreateBinary()) {
|                     ^
`----

According to the standard (C99 6.7.4, §6):

,----
| Any function with internal linkage can be an inline function. For a
| function with external linkage, the following restrictions apply: If a
| function is declared with an inline function specifier, then it shall
| also be defined in the same translation unit. If all of the file scope
| declarations for a function in a translation unit include the inline
| function specifier without extern, then the definition in that
| translation unit is an inline definition. An inline definition does not
| provide an external definition for the function, and does not forbid an
| external definition in another translation unit.
`----

So the code is invalid in C99 (and C11, which GCC 5 uses by default).
Your upstream has chosen not to inline the isCreateBinary() function
anymore:

https://github.com/dzerbino/velvet/commit/73ff67db706f63233f4c29b1e00e960c8cb09975


Cheers,
       Sven



More information about the Debian-med-packaging mailing list