Article View: comp.std.c
Article #3867Re: Parenthesized type name in parameter declaration
From: John Rickard
Date: Sat, 26 Aug 1995 13:40
Date: Sat, 26 Aug 1995 13:40
35 lines
1593 bytes
1593 bytes
Paul Long (plong@perf.com) wrote: : What is meant by this passage in the Sematics section of 6.5.4.3? : : "In a parameter declaration, a single typedef name in parentheses is taken to : be an abstract declarator that specifies a function with a single parameter, : not as a redundant parentheses around the identifier for a declarator." I think you've overlooked the difference between a declaration and a declarator. The passage refers to cases like typedef int t; int foo(long (t)); in which `long (t)' is the (parameter-)declaration. `(t)' is not interpreted as a declarator, which would have made the declaration of foo equivalent to any of the following (assuming the same typedef of t) int foo(long t); int foo(long n); int foo(long (n)); but as an abstract declarator, so the declaration of foo is equivalent to any of the following int foo(long (int)); int foo(long (*)(t)); int foo(long r(t)); int foo(long (*r)(int)); (Note that `int bar(int f())' means the same as `int bar(int (*f)())', in much the same way as `int bar(int a[])' means the same as `int bar(int *a)'.) -- John Rickard
Technical Details
Message-ID:
<41n87t$rn0@gatekeeper.atml.co.uk>Path:
arc1-ca.pugleaf.net!news.atml.co.uk!jrrReferences:
<41iitl$m9m@news0.rain.rg.net>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!news.atml.co.uk!jrr From: jrr@atml.co.uk (John Rickard) Newsgroups: comp.std.c Subject: Re: Parenthesized type name in parameter declaration Date: 26 Aug 1995 13:40:13 GMT Organization: Advanced Telecommunications Modules Ltd, Cambridge, UK. Message-ID: <41n87t$rn0@gatekeeper.atml.co.uk> References: <41iitl$m9m@news0.rain.rg.net> NNTP-Posting-Host: marlin.atml.co.uk X-Newsreader: TIN [version 1.2 PL2]