Deutsch   English   Français   Italiano  
<vjg0ta$31fff$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: James Kuyper <jameskuyper@alumni.caltech.edu>
Newsgroups: comp.lang.c
Subject: Re: question about linker
Date: Thu, 12 Dec 2024 19:59:10 -0500
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <vjg0ta$31fff$1@dont-email.me>
References: <vi54e9$3ie0o$1@dont-email.me> <vi6sb1$148h7$1@paganini.bofh.team>
 <vi6uaj$3ve13$2@dont-email.me> <87plmfu2ub.fsf@nosuchdomain.example.com>
 <vi9jk4$gse4$1@dont-email.me> <vi9kng$gn4c$1@dont-email.me>
 <87frnbt9jn.fsf@nosuchdomain.example.com> <viaqh0$nm7q$1@dont-email.me>
 <877c8nt255.fsf@nosuchdomain.example.com> <viasv4$nm7q$2@dont-email.me>
 <vibr1l$vvjf$1@dont-email.me> <vic73f$1205f$1@dont-email.me>
 <20241129142810.00007920@yahoo.com> <vicfra$13nl4$1@dont-email.me>
 <20241129161517.000010b8@yahoo.com> <vicque$15ium$2@dont-email.me>
 <vid110$16hte$1@dont-email.me> <87mshhsrr0.fsf@nosuchdomain.example.com>
 <vidd2a$18k9j$1@dont-email.me> <8734j9sj0f.fsf@nosuchdomain.example.com>
 <vihhkj$2er60$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 13 Dec 2024 01:59:23 +0100 (CET)
Injection-Info: dont-email.me; posting-host="1f403b47916cb6937002303612cac34f";
	logging-data="3194351"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX181aoCQJ03/A6c2vmdf5WZt4cV2X97Yji4="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:6xtHhvskTaOrQeyZgQSjBmSe3Qo=
In-Reply-To: <vihhkj$2er60$1@dont-email.me>
Content-Language: en-US

On 12/1/24 06:34, David Brown wrote:
> On 30/11/2024 00:44, Keith Thompson wrote:
....
>> David apparently has a different definition of "totally different types"
>> than you do.  Since the standard doesn't define that phrase, I suggest
>> not wasting time arguing about it.
>>
> 
> "int", "void" and "double" are totally different types in my view. 
> "int", "pointer to int", "array of int", "function returning int" all 
> have a relation that means I would not describe them as /totally/ 
> different types - though I would obviously still call them /different/ 
> types.
> 
> The syntax of C allows one declaration statement to declare multiple 
> identifiers of types related in this way - it does not allow declaration 
> of types of /totally/ different types.

There's a rule I sometimes find useful, when trying to choose a precise
definition for a poorly defined term: figure out what statements you'd
like to say using the term, then define it in such a way as to guarantee
that those statements are correct.

In C, a declaration may contain an init-declarator-list, preceded by
declaration-specifiers and optionally by an attribute-specifer-sequence
(6.7p1). Each of the declarators in the list share the
declaration-specifiers and the attribute-specifier-sequence (6.7p7). Any
syntax that's part of a declarator applies to that declarator's identifier.

Therefore, your statement suggests that two types should be considered
"totally different types" if they are incompatible in either the
declaration-specifiers or the attribute-specifier-sequence. With that
definition, 6.7p7 in the standard would guarantee the truth of your
statement above.

Does that definition sound suitable?