While creating the updated Debian package for version 2.14 I ran into this compilation issue:
~~~~^~~~~~~~~~
jtag3io.cc: At global scope:
jtag3io.cc:358:39: error: expected ',' or '...' before '__unused'
358 | bool jtag3::synchroniseAt(int bitrate __unused)
| ^~~~~~~~
jtag3io.cc: In member function 'virtual bool jtag3::synchroniseAt(int)':
jtag3io.cc:358:31: warning: unused parameter 'bitrate' [-Wunused-parameter]
358 | bool jtag3::synchroniseAt(int bitrate __unused)
| ~~~~^~~~~~~
make[3]: [Makefile:530: jtag3io.o] Error 1
make[3]: Waiting for unfinished jobs....
The gcc10 here in Debian does choke on the "unused." The attached patch adds an feature check using AX_GCC_VAR_ATTRIBUTE from the autoconf-archive [1] wether a define is needed and the defines __unused to __arttibute((unused)) which is understood by many compilers, according to [1]. If not, it is left alone (because I assume that the code compiles on your side)
[1] https://www.gnu.org/software/autoconf-archive/ax_gcc_var_attribute.html#ax_gcc_var_attribute
Cheers,
tobi
On Thu, Sep 17, 2020 at 08:36:39PM -0000, Joerg Wunsch wrote:
Thanks Jörg for fixing it that fast ;)
I was just unsure if hardcoding was ok with you, I assumed you have some
compiler that understands __unused natively and I didnt want to break
stuff on your side. (For completeness The AX_… macro is Debian in the
autoconf-archive package, and (at least here found automatically when it
is installed and a autoreconf -f -i is done. Otherwise it'd be here:
http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_gcc_var_attribute.m4)
BTW, Many thanks for maintaining avarice!
Cheers,
tobi
Well, the AX_GCC_VAR_ATTRIBUTE was missing in my autoconf version.
Thus I decided it's easier to simply replace
__unused
by__attribute__((unused))
in the few places where it's being used.