jejones@mcrware.UUCP (James Jones) (10/17/90)
I just noticed the special case mentioned on lines 2-4 of page 81 of the 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)". Questions: 1. What is the type of the value returned by the function taking a single typedef-name type argument? 2. Where is the prior art for this context-sensitive interpretation? I certainly don't want to start a sequence of messages concerning C type syntax, but whatever one thinks of it, I don't believe it ever had this sort of (highly misleading, IMHO) special case. James Jones
gwyn@smoke.BRL.MIL (Doug Gwyn) (10/18/90)
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.