I don't believe my concerns about the interaction with parameter forward declarations have been addressed in any revision of this patch.
This is genuinely an issue with the interaction of two features; it doesn't arise with either feature in isolation. (a) It's not an issue with parameter forward declarations in isolation because the length of an array parameter *is not part of the type relevant for any subsequent reference to or declaration of that parameter*, so differences in array lengths cannot affect type compatibility or anything else. (b) It's not an issue with _Countof as it exists in C2Y because that only applies to arrays, not to pointers, so the standard feature does not provide a way to observe array lengths that do not end up forming part of the type. So when you introduce this interaction by adding _Countof on array parameters, you need to (a) work out the desired semantics, (b) document them, (c) implement them and (d) ensure they are properly covered in the testsuite. (Even defining as "not permitted on any parameter with a forward declaration" to avoid these issues could be awkward when you might not know at the point _Countof is encountered whether a previous parameter referenced will turn out to be a forward declaration or not.) -- Joseph S. Myers [email protected]
