[cfe-users] Clang (with Visual Studio) wrongly complains about missing variables

John Emmas via cfe-users cfe-users at lists.llvm.org
Tue Sep 21 00:54:30 PDT 2021


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


More information about the cfe-users mailing list