On Thu Jul 6 10:10:11 2023 +0000, Alexandre Julliard wrote:
I don't think this is worth fixing. Typedef redefinitions are a C11
feature, and Wine already requires the compiler to support other C11 features like anonymous unions and designated initializers. I would prefer to just document that Wine requires the compiler to support C11 and not attempt to support any compiler that falls short. We don't compile code with a C standard, we compile it with the actual compilers that people have on their machine, none of which are 100% standards-compliant. If actual users are running into a problem, we want to make an effort to fix it. If the fix turns out to be too complicated or ugly, we may decide not to implement it, but we should never refuse to support users just because of what some C standard says.
Hi Alexandre, thanks for chiming in.
The problem with not having a standard is that it makes it very difficult for contributors to know which language features are allowed in Wine and which are not. For example, right now anonymous unions, designated initializers, and flexible array members are required (which break old compilers), whereas // comments and declaring variables in the middle of a function or at the beginning of a for loop are forbidden (presumably for the benefit of old compilers), and typedef redefinitions are a gray area. What C compiler supports designated initializers but not // comments?
Maybe Wine's rules about comments and variables are just for stylistic reasons and not compatibility. If that is the case, let's clearly explain it in the wiki. Let's also clearly explain what other language features are not allowed and why (such as duplicate typedef definitions because of GCC 4.3).