Skip to content

Compilation fails with newer gcc/clang due to C99 'inline' vs C89 'inline' #14

@dnbaker

Description

@dnbaker

Unresolved symbol errors occur when using gcc7 or 6 but succeeds with gcc4.

See http://clang.llvm.org/compatibility.html#inline for an explanation. A fix is simply replacing "inline" with "static inline", which I can confirm works with gcc7 and clang.

Example error:

Undefined symbols for architecture x86_64:
  "_helper_double_10", referenced from:
      _fht_double in fht.o
  "_helper_double_11", referenced from:
      _fht_double in fht.o
  "_helper_double_5", referenced from:
      _fht_double in fht.o
  "_helper_double_6", referenced from:
      _fht_double in fht.o
  "_helper_double_7", referenced from:
      _fht_double in fht.o
  "_helper_double_8", referenced from:
      _fht_double in fht.o
  "_helper_double_9", referenced from:
      _fht_double in fht.o
  "_helper_float_12", referenced from:
      _fht_float in fht.o
  "_helper_float_4", referenced from:
      _fht_float in fht.o
  "_helper_float_5", referenced from:
      _fht_float in fht.o
  "_helper_float_6", referenced from:
      _fht_float in fht.o
  "_helper_float_9", referenced from:
      _fht_float in fht.o
ld: symbol(s) not found for architecture x86_64

This is fixed in my fork, but it also adds some additional methods which might not be worthy of inclusion and a simple replacement of 'inline' with 'static inline' might be preferable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions