Closed travisdowns closed 5 years ago
Maybe
HEDLEY_ALWAYS_INLINE
should includeinline
I think so. What version are you using? HEDLEY_ALWAYS_INLINE
should include HEDLEY_INLINE
since v7.
If that's not it, what compiler versions and flags are you using?
Oops
#define HEDLEY_VERSION 1
Sorry, I copied this from somewhere else locally and I must have gotten this old version. Let me check w/ the newest version.
That was the problem, sorry for the noise.
The one consolation is that I think the documentation is still wrong in that the implementation section doesn't show the fact that inline is included:
Thanks for reporting instead of just adding HEDLEY_INLINE
to your code; I'd much rather hear about this type of issue.
You're right about the docs being out of date. I just pushed an update, thanks!
The documentation for
HEDLEY_ALWAYS_INLINE
gives the following example:However, even if the function body is included, like:
This will give a warning with
-Wall
(and fail to compile with-Werror
):See godbolt.
The problem is that the function is not also declared
inline
. I.e.,__attribute__((__always_inline__))
does not implyinline
.Maybe
HEDLEY_ALWAYS_INLINE
should includeinline
, but at a minimum the documentation should be updated.