tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] "identifier expected"? But not by GCC.


From: lostgallifreyan
Subject: Re: [Tinycc-devel] "identifier expected"? But not by GCC.
Date: Sat, 18 Apr 2009 09:19:22 +0100

KHMan <address@hidden> wrote:
(18/04/2009 05:02)

> ..... Are you 
>compiling in C++ mode? That wouldn't be good practice if there is 
>a commitment to code stuff in a platform-neutral and 
>compiler-neutral way. Other compilers that assumes proper C code 
>may break on such code snippets.
>
>Anyway, this is getting to be OT, so I'll stop here.
>

Agreed, since it's established not to be TCC causing this. To answer you 
though, and end the saga, I was unknowingly asking GCC to compile as C++, turns 
out that instead of seeing the actual file extension of .c, it was seeing the 
DOS shortname path literally (as TCC does), so it saw a .C and compiled 
accordingly. I've modified my batch files so they send the right commands now.
Thankyou.

Grishka, if you are reading this, it might be worth noting that GCC still 
allows the distinction between .c and .C to matter even in Windows if the 
command line is written appropriately. My patch would still allow this, yours 
wouldn't. Not relevant now perhaps, but if TCC ever does C++, it will be later.

To answer my own question about use of braces and avoiding loose coding, I've 
decided that as a block of statements warrants more than one line and thus uses 
braces, declarations are best made there too. if one line is enough, I'll 
declare a variable at the most recent point that allows it. (I like to omit 
un-necessary braces or whitespace, that way I can tell what's important because 
it's still there).





reply via email to

[Prev in Thread] Current Thread [Next in Thread]