tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Basic patch for passing W9X short DOS paths to TCC.


From: grischka
Subject: Re: [Tinycc-devel] Basic patch for passing W9X short DOS paths to TCC.
Date: Wed, 15 Apr 2009 15:50:56 +0200
User-agent: Thunderbird 1.5.0.10 (Windows/20070221)

lostgallifreyan wrote:
Joshua Phillips <address@hidden> wrote:
(15/04/2009 13:46)

stricmp or strcasecmp would be provided by the C library. Tcc is only a compiler - it doesn't include a C library. Therefore, the presence of stricmp or strcasecmp will be determined by the C library you're using (GNU libc or MSVCRT or other)


Ok, that makes sense, but if it were only the library that determines what's 
there, TCC might compile C++. As it doesn't I assume it's not just the library 
that determines this.
(That remark is based in my possibly erroneous assumption that C++ is a kind of 
superset of C with a lot more dedicated functions).
In short, doesn't the compiler have to 'understand' what it's compiling?

In short, yes and no.  The initial vocabulary (keywords) of a
C compiler is rather small:

     char short int long float double enum void
     signed unsigned
     typedef struct union sizeof
     const extern static
     if else while do for
     continue break goto return switch case default

And some others.  The complete list for TCC is in "tcctok.h".

A C++ compiler knows a few additional keywords, like
     bool class new delete
     ...

However the compiler "learns" more words as it reads the include
files and the program text.  E.g. with TinyCC it learns "pstrcat"
and "dynarray_add" and "put_ext_sym2" and whatnot.

It learns enough about these words to speak them, but it doesn't
understand their meaning.  It understands the meaning of its own
keywords though.





reply via email to

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