======================= Cover sheet starts here ============ Document Number: WG14 N___/X3J11 __-___ C9X Revision Proposal ===================== Title: Removal of "auto" keyword Author: David R. Tribble Author Affiliation: Self Postal Address: 6004 Cave River Dr. Plano, TX 75093-6951 USA E-mail Address: dtribble@technologist.com Telephone Number: +1 972 738 6125 work Fax Number: +1 972 738 6111 Sponsor: Date: 1995-03-19 Proposal Category: __ Editorial change/non-normative contribution __ Correction __ New feature X_ Addition to obsolescent feature list __ Addition to Future Directions __ Other (please specify) ______________________________ Area of Standard Affected: __ Environment X_ Language __ Preprocessor __ Library __ Macro/typedef/tag name __ Function __ Header __ Other (please specify) ______________________________ Prior Art: None, although the "entry" keyword was removed in the previous ANSI/ISO C spec. Target Audience: C programmers, and programmers who write programs that generate C code. Related Documents (if any): None. Proposal Attached: X_ Yes __ No, but what's your interest? Abstract: The "auto" keyword is rarely, if ever, used. It is redundant when it is used (to declare variables local to a function). Therefore, it should be deemed OBSOLETE as a reserved keyword. ======================= Cover sheet ends here ============== PROPOSAL The "auto" keyword shall be deemed OBSOLETE. RATIONALE The "auto" keyword is redundant and unnecessary. It is only used to declare variables with block scope within function bodies and compound statements (blocks) [?]. Most programmers never use the "auto" keyword, since it is implicit when defining local variables. Some program generators might be affected, however, by the removal of the "auto" keyword. SYNTAX This affects the lexical analysis of programs, because there is one less keyword. AFFECT TO EXISTING PROGRAMS If a given implementation has removed the "auto" keyword from its lexicon, old programs may still be compiled successfully by adding this directive to the code: #define auto Note that the same effect can be gotten with most compilers by using a compiler option: cc -Dauto= foo.c COMPATIBILITY The "auto" may also be considered for obsolescence or removal in C++. IMPACT This affects [6.1.1], [6.5.1], [6.7], [6.9.3]. These are mostly removals of references of "auto" variables. This may (but probably doesn't) affect [6.1.2.2], [6.1.2.4], [6.5], [6.6.2], [6.7.1]. ======= END OF PROPOSAL ===========================================