Public Comment Number PC-UK0102 ISO/IEC CD 9899 (SC22N2620) Public Comment =========================================== Date: 1998-02-25 Author: N.M Maclaren Author Affiliation: Self Postal Address: University of Cambridge, Computer Laboratory, New Museums Site, Pembroke Street, Cambridge CB3 3QG, United Kingdom E-mail Address: Telephone Number: +44 1223 334761 Fax Number: +44 1223 334679 Number of individual comments: 1 Comment 1. Category: Other (suggestion for deprecated practice) Committee Draft subsection: 6.1.2.2 Title: Linkages of identifiers Detailed description: Linkages were one of the nastiest and least-defined aspects of K&R C; almost every early ISO/ANSI compiler got the C89 semantics wrong in many and varied ways. While the conformance of implementations has improved, paragraphs 4 and 5 hide some extremely deceptive traps for the programmer; in particular, the fact that 'extern' does not necessary imply external linkage, even on definitions, and can even imply the converse. A large number of these traps are there mainly to support upwards compatibility for code written for K&R compilers that did not allow the static keyword in declarations that were not definitions (and so subverted the extern keyword to mean 'extern or static' in that case.) It is clearly impossible to withdraw these facilities, but preparing to allow an improvement in some future standard would seem wise. I suggest adding the following after paragraph 7: Recommended practice Defining an identifier with the storage-class specifier extern when it has internal linkage is deprecated. Declaring (when not defining) an identifier with internal or external linkage and no storage-class specifier is also deprecated. An implementation shall issue a diagnostic but continue normal processing in such cases. 6.5.4 Function specifiers introduces a related and even nastier trap, which is commented on elsewhere.