kernelwernel / VMAware

VM detection library and tool
MIT License
347 stars 37 forks source link

fix constant value error for vm_files_extra #67

Closed alandtse closed 6 months ago

alandtse commented 6 months ago

This fixes the following warnings and compiler errors in VS2022 and VSCode.

error C2131: expression did not evaluate to a constant expression must have a constant value C/C++(28)

alandtse commented 6 months ago

Thanks again for putting this project together. I ran into a compilation issue when using this in a Visual Studio project running off main. This fixed it for me.

kernelwernel commented 6 months ago

Thanks! I really appreciate the fix :)

EDIT: nevermind it didn’t compile right, let me look into it later

alandtse commented 6 months ago

Yah that's odd, that's the exact build error I was seeing but resolved on my end with the change.

kernelwernel commented 6 months ago

Yah that's odd, that's the exact build error I was seeing but resolved on my end with the change.

is it possible if you can share me the compiler flags you're using?

alandtse commented 6 months ago
FLAGS = /permissive- /Zc:preprocessor /EHa /O2 /Ob2 /DNDEBUG /Zi -std:c++latest -MD /GL /wd4005 /wd4061 /wd4068 /wd4200 /wd4201 /wd4265 /wd4266 /wd4371 /wd4514 /wd4582 /wd4583 /wd4623 /wd4625 /wd4626 /wd4710 /wd4711 /wd4820 /wd4996 /wd5026 /wd5027 /wd5045 /wd5053 /wd5204 /wd5220
kernelwernel commented 6 months ago

Maybe I shouldn't had merged it too soon, but can you let me know if this fixes your issue?

alandtse commented 6 months ago

I mean char will break on international strings I think, but ok.

kernelwernel commented 6 months ago

I mean char will break on international strings I think, but ok.

All the strings in the constexpr array only use ASCII, so that's not a concern for me. Thank you for pointing this out though, I really appreciate it :)