Deutsch   English   Français   Italiano  
<vjd96b$1pbed$1@dont-email.me>

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

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bart <bc@freeuk.com>
Newsgroups: comp.lang.c
Subject: Re: question about linker
Date: Thu, 12 Dec 2024 00:02:19 +0000
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <vjd96b$1pbed$1@dont-email.me>
References: <vi54e9$3ie0o$1@dont-email.me> <vifcll$1q9rj$1@dont-email.me>
 <vifiib$1s07p$1@dont-email.me> <87ldwx10gv.fsf@bsb.me.uk>
 <vimtt4$27vv$1@dont-email.me> <86ser1kgp5.fsf@linuxsc.com>
 <vit69t$1qfgg$1@dont-email.me> <87ldwtzlc0.fsf@nosuchdomain.example.com>
 <vitjgg$1tukq$2@dont-email.me> <vj1bss$325uo$1@dont-email.me>
 <vj1h4i$335q1$2@dont-email.me> <vj1mhi$34p7h$1@dont-email.me>
 <vj1prj$35je4$1@dont-email.me> <vj7dup$he7i$1@dont-email.me>
 <vjasuj$17uod$1@dont-email.me> <vjc87h$1apid$1@paganini.bofh.team>
 <vjcbe1$1jns0$1@dont-email.me> <87wmg5x4b1.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 12 Dec 2024 01:02:19 +0100 (CET)
Injection-Info: dont-email.me; posting-host="021d91925d3f1b965194e346b20c998a";
	logging-data="1879501"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+67W7S3wPXxcYhYkTTPTXk"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:fC7eq0+ArynRK8XOEPp8dlBdlGI=
In-Reply-To: <87wmg5x4b1.fsf@nosuchdomain.example.com>
Content-Language: en-GB
Bytes: 2915

On 11/12/2024 22:06, Keith Thompson wrote:
> bart <bc@freeuk.com> writes:
> [...]
>> You need input from a symbol table in order to parse C, a table that
>> the parser needs to maintain as it processes source code. That will
>> tell you whether a particular identifier is a typename or not.
> 
> Yes.  (I've mentioned this a number of times.)
> 
>> There are issues also with keywords like 'break'.
> 
> What issues?

I see that the C grammar treats both kinds of 'break' as a jump. I for 
one generate two separate constructs for the two kinds. That requires 
keeping track of the stack of nested switch/while/for/dowhile statements.

> If you're referring to the fact that break can apply either to a loop or
> to a switch, that's a potential source of confusion, but it shouldn't be
> a problem once you're aware of it.

It can be very much a problem. Suppose you have an if-else chain within 
a loop that contains loop-break. Later you upgrade it to switch. Now it 
no longer jumps to the end of the loop, but the end of the switch.

Even if aware of it, now you're stuck for getting to the end of the 
loop. It can also happen in reverse when you downgrade a switch to 
if-else. And to a lesser extent when you wrap a case-block containing 
'break' with a loop.

I don't know why two different keywords weren't used for this instead of 
having to share.