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
Change History
comment:1 Changed 2 years ago by segher
- Owner set to stuge
- Status changed from new to assigned
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.
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
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.
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.