Johan Engelen via llvm-dev
2015-Dec-20 16:18 UTC
[llvm-dev] MSVC warning noise on "LLVM_ATTRIBUTE_ALWAYS_INLINE inline void foo()"
Hi all, Some functions have "inline" specified twice by use of LLVM_ATTRIBUTE_ALWAYS_INLINE. For example in StringRef.h: LLVM_ATTRIBUTE_ALWAYS_INLINE inline bool operator==(StringRef LHS, StringRef RHS); This results in warning noise when compiled with MSVC 2015: \include\llvm/ADT/StringRef.h(567): warning C4141: 'inline': used more than once \include\llvm/ADT/StringRef.h(572): warning C4141: 'inline': used more than once \include\llvm/IR/User.h(43): warning C4141: 'inline': used more than once Thanks very much for a fix. (I hope that simply removing the "inline" after LLVM_ATTRIBUTE_ALWAYS_INLINE is correct) Kind regards, Johan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151220/8ea4526d/attachment.html>
Xinliang David Li via llvm-dev
2015-Dec-20 22:24 UTC
[llvm-dev] MSVC warning noise on "LLVM_ATTRIBUTE_ALWAYS_INLINE inline void foo()"
LLVM_ATTRIBUTE_ALWAYS_INLINE is defined to be __forceinline for MSVC. I wonder why you get that warning. David On Sun, Dec 20, 2015 at 8:18 AM, Johan Engelen via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hi all, > Some functions have "inline" specified twice by use of > LLVM_ATTRIBUTE_ALWAYS_INLINE. > For example in StringRef.h: > LLVM_ATTRIBUTE_ALWAYS_INLINE > inline bool operator==(StringRef LHS, StringRef RHS); > > This results in warning noise when compiled with MSVC 2015: > \include\llvm/ADT/StringRef.h(567): warning C4141: 'inline': used more > than once > \include\llvm/ADT/StringRef.h(572): warning C4141: 'inline': used more > than once > \include\llvm/IR/User.h(43): warning C4141: 'inline': used more than once > > Thanks very much for a fix. > (I hope that simply removing the "inline" > after LLVM_ATTRIBUTE_ALWAYS_INLINE is correct) > > Kind regards, > Johan > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151220/de2b4cf8/attachment.html>
Aaron Ballman via llvm-dev
2015-Dec-20 22:28 UTC
[llvm-dev] MSVC warning noise on "LLVM_ATTRIBUTE_ALWAYS_INLINE inline void foo()"
On Sun, Dec 20, 2015 at 5:24 PM, Xinliang David Li via llvm-dev <llvm-dev at lists.llvm.org> wrote:> LLVM_ATTRIBUTE_ALWAYS_INLINE is defined to be __forceinline for MSVC. I > wonder why you get that warning.inline and __forceinline don't mix with MSVC -- I believe they may be modeled with the same attribute under the hood. I'm not certain of the best way to solve this aside from suggesting to ignore C4141 locally. ~Aaron> > David > > On Sun, Dec 20, 2015 at 8:18 AM, Johan Engelen via llvm-dev > <llvm-dev at lists.llvm.org> wrote: >> >> Hi all, >> Some functions have "inline" specified twice by use of >> LLVM_ATTRIBUTE_ALWAYS_INLINE. >> For example in StringRef.h: >> LLVM_ATTRIBUTE_ALWAYS_INLINE >> inline bool operator==(StringRef LHS, StringRef RHS); >> >> This results in warning noise when compiled with MSVC 2015: >> \include\llvm/ADT/StringRef.h(567): warning C4141: 'inline': used more >> than once >> \include\llvm/ADT/StringRef.h(572): warning C4141: 'inline': used more >> than once >> \include\llvm/IR/User.h(43): warning C4141: 'inline': used more than >> once >> >> Thanks very much for a fix. >> (I hope that simply removing the "inline" after >> LLVM_ATTRIBUTE_ALWAYS_INLINE is correct) >> >> Kind regards, >> Johan >> >> >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >> > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >
Apparently Analagous Threads
- MSVC warning noise on "LLVM_ATTRIBUTE_ALWAYS_INLINE inline void foo()"
- MSVC warning noise on "LLVM_ATTRIBUTE_ALWAYS_INLINE inline void foo()"
- Disabling LLVM_ATTRIBUTE_ALWAYS_INLINE for development?
- Disabling LLVM_ATTRIBUTE_ALWAYS_INLINE for development?
- Disabling LLVM_ATTRIBUTE_ALWAYS_INLINE for development?