Ticket #97 (closed defect: fixed)

Opened 2 years ago

Last modified 19 months ago

[PATCH] "-fgnu89-inline" should not be used when building with clang

Reported by: rogueresearch Owned by: stuge
Milestone: Component: libusb-1.0
Keywords: Cc:
Blocked By: Blocks:

Description

When building libusb master with clang it warns:

clang: warning: argument unused during compilation: '-fgnu89-inline'

That flag is apparently specific to gcc, and should should not be used with clang and probably other compliers too.

Attachments

0001-fixed-ticket-97-removed-gnu89-inline-semantics.patch (964 bytes) - added by rogueresearch 2 years ago.
patch for bug #97

Download all attachments as: .zip

Change History

comment:1 Changed 2 years ago by segher

  • Owner set to stuge
  • Status changed from new to assigned

autoconf checks if the compiler accepts that flag; and the compiler
did. Presumably it just warned as well, so the autoconf test is
broken for clang.

But, why do we have this at all? We do not want GNU89 inline
semantics (no one sane does!) Also, we do not _use_ it anyway,
since all inlines are static inline (except one "upperize" in
the mswindows code, which should probably be fixed).

So we should probably just delete this autoconf test.

comment:2 Changed 2 years ago by rogueresearch

clang tries hard to be gcc compatible, so you're probably right about how the autoconf test proceeds.

I like your solution better. :) I tested locally and everything builds fine with the flag removed.

comment:3 Changed 2 years ago by segher

Did you test with GCC as well? And it sounds like you have a
patch, care to share? :-)

comment:4 Changed 2 years ago by rogueresearch

My test was to replace "-fgnu89-inline" with "". I'm not familiar with autotools and the syntax used in configure.ac, so I'm not really qualified, but it looks to me like the entire block under the "Restore gnu89 inline semantics on gcc 4.3 and newer" comment can just be removed.

Changed 2 years ago by rogueresearch

patch for bug #97

comment:5 Changed 2 years ago by rogueresearch

  • Summary changed from "-fgnu89-inline" should not be used when building with clang to [PATCH] "-fgnu89-inline" should not be used when building with clang

comment:6 Changed 22 months ago by rogueresearch

In [9da384914d8843d73b5c3750398b431660b6f3ca/libusb-pbatard]:

configure.ac: Fix #97 clang warning about -fgnu89-inline

Remove the test that sets the flag since GNU89 inline semantics are not
required by libusb.

[stuge: Also remove reference to the test result]

comment:7 Changed 21 months ago by rogueresearch

  • Resolution set to fixed
  • Status changed from assigned to closed

Confirmed fixed in http://git.libusb.org/libusb.git "testing" branch.

comment:8 Changed 19 months ago by stuge

In [6635dbb4acb5ee556a020e431b15c954edfcbd29/libusb]:

Windows: Make upperize() in windows_usb.h static

References #97.

comment:9 Changed 19 months ago by pbatard

In [cb3c2e488f298b78027c9d5fc0bec0e5ba27d761/libusb]:

Windows: Make cancel_io() in poll_windows.c static

References #97.

comment:10 Changed 19 months ago by rogueresearch

In [bb8854ff5680136e29b57505300f131c2646f258/libusb]:

configure.ac: Fix #97 clang warning about -fgnu89-inline

Remove the test that sets the flag since GNU89 inline semantics are not
required by libusb.

[stuge: Also remove reference to the test result]

Note: See TracTickets for help on using tickets.