Menu

#39 Compilation error in jtag3io.cc: (avarice 2.14)

Unstable_(example)
closed
None
5
2020-09-17
2020-09-17
No

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

1 Attachments

Discussion

  • Joerg Wunsch

    Joerg Wunsch - 2020-09-17
    • status: open --> closed
    • assigned_to: Joerg Wunsch
     
    • Tobias Frost

      Tobias Frost - 2020-09-18

      On Thu, Sep 17, 2020 at 08:36:39PM -0000, Joerg Wunsch wrote:

      • status: open --> closed
      • assigned_to: Joerg Wunsch
      • Comment:

      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.

      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

       
  • Joerg Wunsch

    Joerg Wunsch - 2020-09-17

    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.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.