VS’s cl compiler has a C compiler, which is used when the source file ends with .c. So, changing restrict to __restrict signals something is amiss. You can get this specific line to compile, but you can stumble upon other problems such as C++ mangling symbols (in C it doesn’t happen).
So, I’d advise against tweaking C code just to be compilable by a C++ compiler. Instead, you should investigate why the C++ compiler is being called to compile C code, which is wrong. C code should be compiled with a C compiler and that’s that.
Yes, but with regards to restrict, the C compiler in VS2017 and VS2019 does not conform with C99. It’s not that the wrong compiler is being used, it’s that Visual Studio has a history of not supporting features of C unless those features also exist in C++.
Microsoft indeed has a decades-long history of some moronic decisions regarding its development tools. A proper, fully compliant C support in Windows can be found in MinGW64’s GCC if you’re willing to develop software written in C without issues. Either this or upgrade to VS 2022. I’ve just compiled VTK 9.3 with that version without any C syntax-related issues.