shader-slang / slang

Making it easier to work with shaders
MIT License
1.81k stars 161 forks source link

Investigate why the compiler warning level 4 is not working as expected #4258

Open jkwak-work opened 1 month ago

jkwak-work commented 1 month ago

One of recent changes increased the compiler warning level from 2 to 4 for the CMake workflow. When the warning level was increased, it was expected to print more warnings but it didn't. It is unclear if the warning level 4 is actually working or not.

One of the cases that should trigger more warnings at level 4 is the use of "../" in "#include" keyword. https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4464?view=msvc-170 There are many lines falling into this case, C4464, but they don't print any warnings.

When inspected from the Visual Studio settings, the project setting of "slang" correctly shows that the warning level is set to 4. When inspected individual files under "slang" project, they also correctly shows the warning level 4.

We should investigate and figure out what is happening.

csyonghe commented 1 month ago

According to the document, the warning is level 4 but is by default off, and you still need to manually turn it on?

jkwak-work commented 1 month ago

I think that is for visual studio 2015. And I am not sure if it is same for 2019 or 2022. I have seen the warning being an annoying problem on another project so I assume it is enabled by default on the later version of visual studios. It is something to be figured out.