Created on 2025-03-13.00:00:00 last changed 3 weeks ago
(From submission #682.)
C allows
extern void x;
C++ does not, as clarified by issue 2475 in 9.1 [dcl.pre] paragraph 8.
This deviation warrants an entry in Annex C.
Possible resolution:
Add a new paragraph to C.7.6 [diff.dcl] as follows:
Affected subclause: 9.1 [dcl.pre]
Change: In C++, no declaration of a variable can have void type. In C, this is allowed, unless the declaration is a definition.
[Example:extern void x; // valid C, invalid in C++
-- end example]
Rationale: Stricter type checking in C++.
Effect on original feature: Deletion of semantically well-defined feature.
Difficulty of converting: Syntactic transformation.
How widely used: Seldom.
History | |||
---|---|---|---|
Date | User | Action | Args |
2025-03-13 00:00:00 | admin | create |