The inline keyword is not defined in the C89 standard, so source files
that include arm_sve.h will fail compilation if -std=c89 is specified.
For consistency with arm_neon.h, we should use inline instead.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Speaking to @DavidTruby about this, it appears that this fix is insufficient -- inline has important semantic meaning in C++ that means that we can't simply omit the keyword here.
The inline keyword bypasses the one-definition rule. If we have a function defined in a header that isn't marked inline, and you include that header in two different source files, then your program is ill formed because it contains 2 definitions of that function. So we have to keep it for C++.
That makes sense and suggests we're missing some additional C++ testing?
Agreed -- this passes all tests at the moment, so we can do better test-wise. The error to do with the one definition rule would crop up at link time, though, so we'd need at least two compilation units to validate this.
One observation is that for arm_neon.h __inline__ is used. So perhaps we can just do likewise and we'll also be consistent across the two ACLE headers?