[Tinycc-devel] GAS symbols

2016-03-14 Thread Vladimir Vissoultchev
Hi,

 

I am trying to compile something very similar to `gcc -S` output (like in
this question
 ) and noticed that TCC does not support labels starting with a dot
('.')

 

Reading GAS documentation   I
noticed that they had the following text for valid identifiers:

 

> Symbols

> 

> A symbol is one or more characters chosen from the set of all letters
(both upper and lower case), digits and the three characters _.$. No 

> symbol may begin with a digit. Case is significant. There is no length
limit: all characters are significant. Symbols are delimited by 

> characters not in that set, or by the beginning of a file (since the
source program must end with a newline, the end of a file is not a 

> possible symbol delimiter). See Symbols.

 

So it seems labels can indeed start with and contain dots. Am I correct in
understanding this text?

 

Also, what is the polite way to commit in mob branch? Do you practice
sending patches to the list beforehand so that anyone can chime in with
problems spotted?

 

I'm sorry my first commits were out of nowhere and then had to revert some
rogue changes that broke some tests. Now I have the tests working under
MinGW.

 

cheers,



___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] MAJOR bug: tcc doesn't detect duplicate cases in switch statements

2016-03-14 Thread Michael B. Smith
I agree that it needs addressing. I just objected to the initial submitted 
patch.

-Original Message-
From: tinycc-devel-bounces+michael=theessentialexchange@nongnu.org 
[mailto:tinycc-devel-bounces+michael=theessentialexchange@nongnu.org] On 
Behalf Of arn...@skeeve.com
Sent: Sunday, March 13, 2016 11:40 PM
To: tinycc-devel@nongnu.org
Subject: Re: [Tinycc-devel] MAJOR bug: tcc doesn't detect duplicate cases in 
switch statements

Amine Najahi  wrote:

> Hi,
>
> The patch is not committed. It is just a hackish way I coded to 
> explore how this cases "bug" could be addressed using tcc's api. It 
> certainly does not handle the gnu "..." extension.
>
> My conclusions is that I agree with Michael's arguments. I, for one, 
> use tcc for its speed, and I can live with it not diagnosing this issue.
> It is too costly for a one pass compiler.
>
> Cheers,
>
> Amine
>
>
> On Sat, Mar 12, 2016 at 5:00 AM, Michael B. Smith < 
> mich...@theessentialexchange.com> wrote:
>
> > I am a rare poster here – but I think your patch leads to all sorts 
> > of problems.
> >
> >
> >
> > Please revert it/don’t commit it.
> >
> >
> >
> > *From:* 
> > tinycc-devel-bounces+michael=theessentialexchange@nongnu.org
> > [mailto:tinycc-devel-bounces+michael=theessentialexchange.com@nongnu
> > .org] *On Behalf Of *Amine Najahi
> > *Sent:* Friday, March 11, 2016 12:13 PM
> > *To:* tinycc-devel@nongnu.org
> > *Subject:* Re: [Tinycc-devel] MAJOR bug: tcc doesn't detect 
> > duplicate cases in switch statements
> >
> >
> >
> > Hi Arnold and tcc folks,
> >
> >
> >
> > Perhaps surprisingly, correcting this bug is quite costly.
> >
> > Here is a tentative patch. I find it messy but working with dynamic 
> > data
> >
> > and passing the cases to the block function are necessary to handle
> >
> > an "unlimited number" of cases and nested switch blocks.
> >
> >
> >
> > Also, since the 'block' function is starting to have too many 
> > arguments, I
> >
> > suggest to create a structure that assembles related arguments such
> >
> > that def_sym, case_sym, cases, and cases_cnt, and any other...
> >
> >
> >
> > Does that sound ok?
> >
> >
> >
> > Regards,
> >
> > Amine
> >
> >
> >
> >
> >
> > On Thu, Mar 10, 2016 at 2:41 PM,  wrote:
> >
> > Hi All.
> >
> > On the latest mob:
> >
> > $ cat foo.c
> > int main(int argc, char**argv)
> > {
> > int a;
> >
> > switch (a) {
> > case 1:
> > case 2:
> > break;
> > case 3:
> > break;
> > case 1:
> > break;
> > default:
> > break;
> > }
> >
> > return 0;
> > }
> > $ PATH=/tmp/tcc/bin:$PATH tcc foo.c
> > $
> >
> > $ gcc foo.c -o foo
> > foo.c: In function ‘main’:
> > foo.c:11:2: error: duplicate case value
> >   case 1:
> >   ^
> > foo.c:6:2: error: previously used here
> >   case 1:
> >   ^
> >
> > This is pretty serious
> >
> > Thanks,
> >
> > Arnold
> >
> > ___
> > Tinycc-devel mailing list
> > Tinycc-devel@nongnu.org
> > https://lists.nongnu.org/mailman/listinfo/tinycc-devel
> >
> >
> >
> > ___
> > Tinycc-devel mailing list
> > Tinycc-devel@nongnu.org
> > https://lists.nongnu.org/mailman/listinfo/tinycc-devel
> >
> >
Whoever it was that posted the note about the standard requiring a diagnostic 
was right on target. This is too fundamental a mistake not to diagnose.

But since I don't make commits, I'll stop complaining. I will also most likely 
stop using tcc, nor will I recommend it in the future.

Good luck folks, you're gonna need it.

Arnold

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] MAJOR bug: tcc doesn't detect duplicate cases in switch statements

2016-03-14 Thread Michael Matz
Hi,

On Sun, 13 Mar 2016, arn...@skeeve.com wrote:

> Whoever it was that posted the note about the standard requiring a 
> diagnostic was right on target.

It was me ...

> This is too fundamental a mistake not to diagnose.

... making a concious decision to conditionally disagree with you (namely 
on your unspelled but implied "at all costs").

> But since I don't make commits, I'll stop complaining. I will also most 
> likely stop using tcc, nor will I recommend it in the future.
> 
> Good luck folks, you're gonna need it.

Please don't rage-quit, the bug reports coming out of gawk development 
are appreciated.  You're one of the few serious tcc users we know about :)


Ciao,
Michael.

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel