Re: [cfe-users] Clang (with Visual Studio) wrongly complains about missing variables
Many thanks Jeff & David, Overnight I remembered that Visual Studio itself offers a specific option to disable inline function expansion. For MSVC itself, this gets done by setting a compiler option called "/Ob" ("/Ob0" indicates disabled). If "/Ob0" isn't specified at compile time, inlining of functions is basically left to the compiler's discretion. I checked this morning and sure enough the "/Ob" option doesn't get sent if I build with VS2019 and Clang - so I'm guessing "/Ob0" wouldn't be recognised by Clang's compiler? So does Clang have it's own command-line option to disable inline function expansion? Or is that something which hasn't been implemented for Clang? Thanks, John ___ cfe-users mailing list cfe-users@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users
Re: [cfe-users] Clang (with Visual Studio) wrongly complains about missing variables
> ... > I checked this morning and sure enough the "/Ob" option doesn't get sent > if I build with VS2019 and Clang - so I'm guessing "/Ob0" wouldn't be > recognised by Clang's compiler? > > So does Clang have it's own command-line option to disable inline > function expansion? Or is that something which hasn't been implemented > for Clang? Thanks, The U&L option is -fno-inline. But I think Clang has an option to consume MSVC style options, so you may be able to use /Ob. I think you can check which MSVC style options Clang accepts with 'clang-cl /?' or 'clang-cl -?'. I don't use Clang on Windows, so I'm not really the person to answer your Windows questions. Sorry about that. Jeff ___ cfe-users mailing list cfe-users@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users
Re: [cfe-users] Clang (with Visual Studio) wrongly complains about missing variables
On 21/09/2021 13:49, Jeffrey Walton wrote: The U&L option is -fno-inline. But I think Clang has an option to consume MSVC style options, so you may be able to use /Ob. I think you can check which MSVC style options Clang accepts with 'clang-cl /?' or 'clang-cl -?'. Thanks again Jeff and you're right... clang-cl /? reveals that it'll handle the Microsoft variant of /Ob0 And according to Visual Studio it is sending that option... So do you happen to know if clang-cl produces some kinda log file (i.e. that'd let me see which commands it actually received?) John ___ cfe-users mailing list cfe-users@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users
Re: [cfe-users] Clang (with Visual Studio) wrongly complains about missing variables
I just found something else which might be significant... I noticed that when linking this exe, I had a linker option enabled called /FORCE:MULTIPLE If I remove that option, the Clang linker then gives me a list of about a dozen duplicated symbols. And with that option I get a similarly sized list showing unresolved symbols. Alternatively, changing it to /FORCE makes the exe compile!! It crashes as soon as I try to run it but at least it gets me a bit closer. John ___ cfe-users mailing list cfe-users@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users