Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!ncar!gatech!purdue!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.std.c Subject: Re: 3.5.4.3, special case parameter declaration Message-ID: <14172@smoke.BRL.MIL> Date: 17 Oct 90 21:18:36 GMT References: <3425@mcrware.UUCP> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 36 In article <3425@mcrware.UUCP> jejones@mcrware.UUCP (James Jones) writes: >I just noticed the special case mentioned on lines 2-4 of page 81 of the Page 69 for most people. >Standard (section 3.5.4.3) that, if I understand rightly, says that a >parameter-declaration of the form "(typedef-name)" is to be interpreted >as if it were "()(typedef-name)". NO, you've misinterpreted this. This is simply a kludge to resolve an ambiguity in the declaration grammar, as exhibited by the following two alternate productions for any example of the type covered by the wording in question: direct-declarator := direct-declarator '(' parameter-type-list ')' parameter-type-list := parameter-list parameter-list := parameter-declaration parameter-declaration := declaration-specifiers declarator [A] OR declaration-specifiers abstract-declarator [B] [A] declarator := direct-declarator direct-declarator := '(' declarator ')' declarator := direct-declarator direct-declarator := identifier [B] abstract-declarator := direct-abstract-declarator direct-abstract-declarator := '(' parameter-type-list ')' parameter-type-list := parameter-list parameter-list := parameter-declaration parameter-declaration := declaration-specifiers declaration-specifiers := type-specifier type-specifier := typedef-name >2. Where is the prior art for this context-sensitive interpretation? This is an inherent problem in the use of abstract-declarator for parameters in prototypes, which of course K&R 1st Edition C simply did not support.