comparison lwcc/README.txt @ 307:9e342c4e4b66 ccdev

Added support for __LINE__, __FILE__, __DATE__, and __TIME__ Added support for the standard __LINE__, __FILE__, __DATE__, and __TIME "macros" and updated the readme form lwcc to reflect the current development state. Note: attempts to define these four macros will succeed but the definitions will be ignored.
author William Astle <lost@l-w.ca>
date Sat, 21 Sep 2013 12:27:48 -0600
parents 40ecbd5da481
children
comparison
equal deleted inserted replaced
306:b08787e5b9f3 307:9e342c4e4b66
1 This is the lwcc C compiler for lwtools. It was written using various other 1 This is the lwcc C compiler for lwtools. It was written using various other
2 C compilers as guides. Special thanks to the developers of the PCC compiler. 2 C compilers as guides. Special thanks to the developers of the PCC compiler.
3 While none of the actual code from PCC was actually used, much of compiler 3 While none of the actual code from PCC was actually used, much of compiler
4 itself served as a template for creating lwcc. 4 itself served as a template for creating lwcc.
5 5
6 This directory is arranged as follows:
7 6
8 driver/ 7 LIMITATIONS AND DESIGN CHOICES
8 ==============================
9 9
10 This contains the source for the front end driver program which will be 10 The direct interface to both the compiler proper and the preprocessor is
11 called "lwcc" and is the public face of the compiler. The lwcc program 11 specifically undefined. Indeed, the preprocessor may, in fact, not be a
12 itself provides various options that are largely compatible with unix C 12 separate program at all. Relying on the specific format of the output of the
13 compilers like gcc. It should be noted that the internal interface between 13 preprocessor is specifically forbidden even though it is possible to obtain
14 the lwcc driver and its back end programs (the preprocessor and compiler 14 preprocessed output from the compiler driver. This is provided for debugging
15 proper) is unspecified and subject to change without notice. The assembler 15 purposes only.
16 and linker (lwasm, lwlink) do have defined public interfaces are are not
17 likely to change substantially.
18 16
17 The preprocessor supports variadic macros. It also supports stringification,
18 and token concatenation but only within a macro expansion. There are
19 examples online that use the construct "#__LINE__" to get a string version
20 of the current line number.
19 21
20 cpp/ 22 The preprocessor defaults to ignoring trigraphs because they are basically a
23 stupid idea on any current system. They have their place for systems where
24 creating the nine characters specified by the trigraphs is very difficult or
25 impossible. It is possible, however, to instruct the preprocessor to decode
26 trigraph sequences.
21 27
22 This is the actual C preprocessor. Its specific interface is deliberately 28 The nonstandard "#pragma once" feature is not supported at all. The effect
23 undocumented. Do not call it directly. Ever. Just don't. Bad Things(tm) will 29 is easily accomplished using standard macros and conditionals. It is,
24 happen if you do. 30 therefore, unneeded complexity.
25 31
32 The nonstandard idea of preprocessor assertions is also completely
33 unsupported. It is just as easy to test predefined macros and such tests are
34 much more portable.
26 35
27 liblwcc/ 36 The preprocessor supports __LINE__, __FILE__, __DATE__, and __TIME__. The
37 compiler itself supports __func__ as a predefined string constant if
38 encountered because there is no way for the preprocessor to determine what
39 function it occurs within. The preprocessor does not define __STDC__,
40 __STDC_VERSION__, or __STDC_HOSTED__. I have seen no truly useful purpose
41 for these and since lwcc does not, at this time, conform to any known C
42 standard, it would be incorrect to define the first two.
28 43
29 This contains any runtime libraries the compiler needs to support its 44 The compiler driver may define additional macros depending on its idea of
30 output. This is usually assembly routines to support complex operations not 45 the context.
31 directly supported by the CPU instruction set.
32 46
33 47
34 RUNTIME INFORMATION 48 RUNTIME INFORMATION
35 =================== 49 ===================
36 50