Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #19920 > unrolled thread
| Started by | Shao Miller <sha0.miller@gmail.com> |
|---|---|
| First post | 2012-04-25 16:33 -0400 |
| Last post | 2012-04-25 21:21 -0400 |
| Articles | 10 — 3 participants |
Back to article view | Back to comp.lang.c
Function Parameter-List with Identifiers Shao Miller <sha0.miller@gmail.com> - 2012-04-25 16:33 -0400
Re: Function Parameter-List with Identifiers Ben Pfaff <blp@cs.stanford.edu> - 2012-04-25 13:50 -0700
Re: Function Parameter-List with Identifiers Shao Miller <sha0.miller@gmail.com> - 2012-04-25 18:00 -0400
Re: Function Parameter-List with Identifiers Ben Pfaff <blp@cs.stanford.edu> - 2012-04-25 15:22 -0700
Re: Function Parameter-List with Identifiers Shao Miller <sha0.miller@gmail.com> - 2012-04-25 18:39 -0400
Re: Function Parameter-List with Identifiers Shao Miller <sha0.miller@gmail.com> - 2012-04-25 17:45 -0400
Re: Function Parameter-List with Identifiers Shao Miller <sha0.miller@gmail.com> - 2012-04-25 18:37 -0400
Re: Function Parameter-List with Identifiers pete <pfiland@mindspring.com> - 2012-04-25 18:20 -0400
Re: Function Parameter-List with Identifiers Shao Miller <sha0.miller@gmail.com> - 2012-04-25 18:38 -0400
Re: Function Parameter-List with Identifiers pete <pfiland@mindspring.com> - 2012-04-25 21:21 -0400
| From | Shao Miller <sha0.miller@gmail.com> |
|---|---|
| Date | 2012-04-25 16:33 -0400 |
| Subject | Function Parameter-List with Identifiers |
| Message-ID | <jn9n36$4o0$1@dont-email.me> |
Good day, respected regulars and other readers!
Quick question: At file scope, suppose we have:
extern void foo(int Bar);
void foo(int bar) { return; }
(Please note the case.) I seem to recall some bit about the former
parameter identifiers being ignored, but can't seem to find that bit.
Does anyone recall if that's so? It's not an identifier-list, but a
parameter-list.
Thank you for your time.
- Shao Miller
[toc] | [next] | [standalone]
| From | Ben Pfaff <blp@cs.stanford.edu> |
|---|---|
| Date | 2012-04-25 13:50 -0700 |
| Message-ID | <87fwbrpmcr.fsf@blp.benpfaff.org> |
| In reply to | #19920 |
Shao Miller <sha0.miller@gmail.com> writes:
> Quick question: At file scope, suppose we have:
>
> extern void foo(int Bar);
> void foo(int bar) { return; }
>
> (Please note the case.) I seem to recall some bit about the former
> parameter identifiers being ignored, but can't seem to find that
> bit. Does anyone recall if that's so? It's not an identifier-list,
> but a parameter-list.
It is so. You can even add "const" to one of the prototypes, if
you like.
(If you want, I'll look up a reference for you.)
[toc] | [prev] | [next] | [standalone]
| From | Shao Miller <sha0.miller@gmail.com> |
|---|---|
| Date | 2012-04-25 18:00 -0400 |
| Message-ID | <jn9s61$2of$1@dont-email.me> |
| In reply to | #19922 |
On 4/25/2012 16:50, Ben Pfaff wrote:
> Shao Miller<sha0.miller@gmail.com> writes:
>
>> Quick question: At file scope, suppose we have:
>>
>> extern void foo(int Bar);
>> void foo(int bar) { return; }
>>
>> (Please note the case.) I seem to recall some bit about the former
>> parameter identifiers being ignored, but can't seem to find that
>> bit. Does anyone recall if that's so? It's not an identifier-list,
>> but a parameter-list.
>
> It is so. You can even add "const" to one of the prototypes, if
> you like.
>
> (If you want, I'll look up a reference for you.)
Thank you for your response.
Since 'const' is a type qualifier, I'm sure you weren't referring to
N1570 6.7.6.3p13 (where 6.7.6.3p2 is relevant for that, too).
Were you suggesting this because of N1570 6.7p4 and 6.7.6.3p15; that
type compatibility is the only consideration for this particular example?
[toc] | [prev] | [next] | [standalone]
| From | Ben Pfaff <blp@cs.stanford.edu> |
|---|---|
| Date | 2012-04-25 15:22 -0700 |
| Message-ID | <87aa1zpi45.fsf@blp.benpfaff.org> |
| In reply to | #19927 |
Shao Miller <sha0.miller@gmail.com> writes:
> On 4/25/2012 16:50, Ben Pfaff wrote:
>> Shao Miller<sha0.miller@gmail.com> writes:
>>
>>> Quick question: At file scope, suppose we have:
>>>
>>> extern void foo(int Bar);
>>> void foo(int bar) { return; }
>>>
>>> (Please note the case.) I seem to recall some bit about the former
>>> parameter identifiers being ignored, but can't seem to find that
>>> bit. Does anyone recall if that's so? It's not an identifier-list,
>>> but a parameter-list.
>>
>> It is so. You can even add "const" to one of the prototypes, if
>> you like.
>>
>> (If you want, I'll look up a reference for you.)
>
> Thank you for your response.
>
> Since 'const' is a type qualifier, I'm sure you weren't referring to
> N1570 6.7.6.3p13 (where 6.7.6.3p2 is relevant for that, too).
I don't have N1570 conveniently at hand.
I'm talking about the final sentence in paragraph 13 in C99
6.7.5.3 "Function declarators (including prototypes)":
(In the determination of type compatibility and of a
composite type, each parameter declared with function or
array type is taken as having the adjusted type and each
parameter declared with qualified type is taken as having
the unqualified version of its declared type.)
> Were you suggesting this because of N1570 6.7p4 and 6.7.6.3p15; that
> type compatibility is the only consideration for this particular
> example?
Sorry, the lack of N1570 makes me not follow this.
[toc] | [prev] | [next] | [standalone]
| From | Shao Miller <sha0.miller@gmail.com> |
|---|---|
| Date | 2012-04-25 18:39 -0400 |
| Message-ID | <jn9ugc$emg$3@dont-email.me> |
| In reply to | #19930 |
On 4/25/2012 18:22, Ben Pfaff wrote:
> Shao Miller<sha0.miller@gmail.com> writes:
>
>> On 4/25/2012 16:50, Ben Pfaff wrote:
>>> Shao Miller<sha0.miller@gmail.com> writes:
>>>
>>>> Quick question: At file scope, suppose we have:
>>>>
>>>> extern void foo(int Bar);
>>>> void foo(int bar) { return; }
>>>>
>>>> (Please note the case.) I seem to recall some bit about the former
>>>> parameter identifiers being ignored, but can't seem to find that
>>>> bit. Does anyone recall if that's so? It's not an identifier-list,
>>>> but a parameter-list.
>>>
>>> It is so. You can even add "const" to one of the prototypes, if
>>> you like.
>>>
>>> (If you want, I'll look up a reference for you.)
>>
>> Thank you for your response.
>>
>> Since 'const' is a type qualifier, I'm sure you weren't referring to
>> N1570 6.7.6.3p13 (where 6.7.6.3p2 is relevant for that, too).
>
> I don't have N1570 conveniently at hand.
>
> I'm talking about the final sentence in paragraph 13 in C99
> 6.7.5.3 "Function declarators (including prototypes)":
>
> (In the determination of type compatibility and of a
> composite type, each parameter declared with function or
> array type is taken as having the adjusted type and each
> parameter declared with qualified type is taken as having
> the unqualified version of its declared type.)
>
>> Were you suggesting this because of N1570 6.7p4 and 6.7.6.3p15; that
>> type compatibility is the only consideration for this particular
>> example?
>
> Sorry, the lack of N1570 makes me not follow this.
Right, that's the C99 counterpart. Thanks!
[toc] | [prev] | [next] | [standalone]
| From | Shao Miller <sha0.miller@gmail.com> |
|---|---|
| Date | 2012-04-25 17:45 -0400 |
| Message-ID | <jn9r8q$tbf$1@dont-email.me> |
| In reply to | #19920 |
On 4/25/2012 16:45, Stefan Ram wrote: > Shao Miller<sha0.miller@gmail.com> writes: >> parameter identifiers being ignored > > N1570 6.7.6.3p15 > Thank you for your response. Forgive me, but I don't quite follow the relevance of that paragraph. It's discussing compatible types. Are you suggesting this piece because of 6.7p4?
[toc] | [prev] | [next] | [standalone]
| From | Shao Miller <sha0.miller@gmail.com> |
|---|---|
| Date | 2012-04-25 18:37 -0400 |
| Message-ID | <jn9ubd$emg$1@dont-email.me> |
| In reply to | #19926 |
On 4/25/2012 18:08, Stefan Ram wrote: > Shao Miller<sha0.miller@gmail.com> writes: >>> N1570 6.7.6.3p15 >> It's discussing compatible types. Are you suggesting this piece because >> of 6.7p4? > > I mention it because it does not mention the parameter identifiers, and > because of 6.2.7p2. > Ok, thanks! :)
[toc] | [prev] | [next] | [standalone]
| From | pete <pfiland@mindspring.com> |
|---|---|
| Date | 2012-04-25 18:20 -0400 |
| Message-ID | <4F9878AA.69F1@mindspring.com> |
| In reply to | #19920 |
Shao Miller wrote:
>
> Good day, respected regulars and other readers!
>
> Quick question: At file scope, suppose we have:
>
> extern void foo(int Bar);
> void foo(int bar) { return; }
>
> (Please note the case.) I seem to recall some bit about the former
> parameter identifiers being ignored, but can't seem to find that bit.
> Does anyone recall if that's so? It's not an identifier-list, but a
> parameter-list.
>
> Thank you for your time.
n1570
6.2 Concepts
6.2.1 Scopes of identifiers
4 If the declarator or type specifier
that declares the identifier appears
within the list of parameter declarations in a function prototype
(not part of a function definition),
the identifier has function prototype scope,
which terminates at the end of the function declarator.
--
pete
[toc] | [prev] | [next] | [standalone]
| From | Shao Miller <sha0.miller@gmail.com> |
|---|---|
| Date | 2012-04-25 18:38 -0400 |
| Message-ID | <jn9udc$emg$2@dont-email.me> |
| In reply to | #19929 |
On 4/25/2012 18:20, pete wrote:
> Shao Miller wrote:
>>
>> Good day, respected regulars and other readers!
>>
>> Quick question: At file scope, suppose we have:
>>
>> extern void foo(int Bar);
>> void foo(int bar) { return; }
>>
>> (Please note the case.) I seem to recall some bit about the former
>> parameter identifiers being ignored, but can't seem to find that bit.
>> Does anyone recall if that's so? It's not an identifier-list, but a
>> parameter-list.
>>
>> Thank you for your time.
>
> n1570
>
> 6.2 Concepts
> 6.2.1 Scopes of identifiers
>
> 4 If the declarator or type specifier
> that declares the identifier appears
> within the list of parameter declarations in a function prototype
> (not part of a function definition),
> the identifier has function prototype scope,
> which terminates at the end of the function declarator.
>
I'm pretty sure that this is the one I was having "reader's block" or
"finder's block" with. Thanks a lot, pete!
[toc] | [prev] | [next] | [standalone]
| From | pete <pfiland@mindspring.com> |
|---|---|
| Date | 2012-04-25 21:21 -0400 |
| Message-ID | <4F98A318.219@mindspring.com> |
| In reply to | #19935 |
Shao Miller wrote:
>
> On 4/25/2012 18:20, pete wrote:
> > Shao Miller wrote:
> >>
> >> Good day, respected regulars and other readers!
> >>
> >> Quick question: At file scope, suppose we have:
> >>
> >> extern void foo(int Bar);
> >> void foo(int bar) { return; }
> >>
> >> (Please note the case.) I seem to recall some bit about the former
> >> parameter identifiers being ignored, but can't seem to find that bit.
> >> Does anyone recall if that's so? It's not an identifier-list, but a
> >> parameter-list.
> >>
> >> Thank you for your time.
> >
> > n1570
> >
> > 6.2 Concepts
> > 6.2.1 Scopes of identifiers
> >
> > 4 If the declarator or type specifier
> > that declares the identifier appears
> > within the list of parameter declarations in a function prototype
> > (not part of a function definition),
> > the identifier has function prototype scope,
> > which terminates at the end of the function declarator.
> >
>
> I'm pretty sure that this is the one I was having "reader's block" or
> "finder's block" with. Thanks a lot, pete!
You're welcome.
--
pete
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.c
csiph-web