annotate docs/ccguide/intro.preface @ 1417:b7b173926ea1

Changes and fixes by Robert Gault
author boisy
date Sun, 30 Nov 2003 22:25:56 +0000
parents a4a6b6315146
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
1 <preface>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
2 <title>Differences between Versions 1.1 and 1.0</title>
612
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
3 <caution>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
4 <title>Important Notice - Please Read Carefully</title>
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
5 <para>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
6 This package contains the OS-9 C Compiler Version 1.1. Many
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
7 improvements and bug fixes have been incorporated since the V1.0
468
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
8 release. If you are upgrading from V1.0, be <emphasis>absolutely sure</emphasis>
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
9 to all <emphasis>all</emphasis> the files from the V1.1 disks. None of the
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
10 compiler sections or the library is compatible with V1.0 files. Any ".r" or
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
11 ".a" files produced by the V1.0 compiler should not be assembled or
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
12 linked with any ".a" or ".r" files produced by the V1.1 compiler.
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
13 To be safe, recompile/reassemble <emphasis>all</emphasis> ".a" and ".r"
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
14 files with V.1.1.
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
15 </para>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
16 <para>
468
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
17 This update include appendices for the C Compiler User's Guide
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
18 describing the compiler error messages, compiler phase command
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
19 lines, interfacing C functions to BASIC09, and an overview of the
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
20 relocating macro assembler.
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
21 </para>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
22 <para>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
23 The remainder of this notice describes the changes made since V1.0.
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
24 </para>
612
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
25 </caution>
468
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
26
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
27 <variablelist>
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
28 <varlistentry><term>General:</term>
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
29 <listitem>
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
30 <para>
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
31 The compiler code generator and c.opt have been improved to
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
32 produce even smaller object code. This, and improved source
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
33 coding, has resulted in a 1 page decrease in the size of c.comp
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
34 and a 4 page decrease in c.pass1.
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
35 </para>
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
36 </listitem>
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
37 </varlistentry>
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
38
532
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
39 <varlistentry><term>Executives (cc1 and cc2):</term>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
40 <listitem>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
41 <para>
612
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
42 -x appearing on the cc1 command line causes the compiler to
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
43 make the c.com command file but not execute it. -q on the cc2
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
44 command line causes the compiler to suppress filename and
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
45 compiler phase messages.
532
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
46 </para>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
47 </listitem>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
48 </varlistentry>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
49
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
50 <varlistentry><term>Preprocessor (c.prep):</term>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
51 <listitem>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
52 <para>
655
a4a6b6315146 Completely finished
roug
parents: 612
diff changeset
53 C.prep now prints a fatal error if a line exceeds 255 bytes.
532
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
54 </para>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
55 </listitem>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
56 </varlistentry>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
57
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
58 <varlistentry><term>Compiler (c.comp, c.pass1, c.pass2):</term>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
59 <listitem>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
60 <para>
612
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
61 C.pass1 float/double conversion is now done properly rather
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
62 than reporting error 7.
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
63 </para>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
64 <para>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
65 Direct and static direct storage classes may now be
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
66 initialized.
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
67 </para>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
68 <para>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
69 Sizeof operator now reports an error when applied to an
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
70 undefined identifier. Sizeof now allows any expression inside
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
71 of parenthesis. Previously, only primaries were allowed.
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
72 </para>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
73 <para>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
74 Various code generation problems involving certain long and
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
75 floating operations have been fixed.
532
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
76 </para>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
77 </listitem>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
78 </varlistentry>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
79
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
80 <varlistentry><term>Optimizer (c.opt):</term>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
81 <listitem>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
82 <para>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
83 C.opt has been improved to use much less dynamic memory while
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
84 performing optimizations.
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
85 </para>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
86 <para>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
87 Some branches were erroneously converted to short branches
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
88 when they should have been long.
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
89 </para>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
90 </listitem>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
91 </varlistentry>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
92
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
93 <varlistentry><term>Assembler (c.asm):</term>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
94 <listitem>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
95 <para>
612
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
96 C.asm can now handle direct-page initialized data.
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
97 </para>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
98 <para>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
99 Some out-of-range short branches were not detected.
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
100 </para>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
101 <para>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
102 VSECT syntax changed to allow direct-page initializers. This
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
103 make V1.0 assembly file incompatible with V1.1.
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
104 </para>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
105 <para>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
106 Macro and repeat block facilities have been added.
532
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
107 </para>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
108 </listitem>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
109 </varlistentry>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
110
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
111 <varlistentry><term>Linker (c.link):</term>
655
a4a6b6315146 Completely finished
roug
parents: 612
diff changeset
112 <listitem><para>
532
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
113 C.link can now handle direct-page initialized data.
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
114 </para>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
115 <para>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
116 C.link will now report if the direct page allocations exceeds 256 bytes.
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
117 </para>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
118 <para>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
119 C.link is about three times faster using the improved V1.1 standard library.
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
120 </para>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
121 <para>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
122 C.link can now output modules that can be entered by the BASIC09 "RUN" command.
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
123 </para>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
124 </listitem>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
125 </varlistentry>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
126
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
127 <varlistentry><term>Library (clib.l):</term>
655
a4a6b6315146 Completely finished
roug
parents: 612
diff changeset
128 <listitem><para>
612
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
129 The standard library FILE structure has been changed to allow
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
130 specification of buffersize for a file. In V1.0, the
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
131 buffersize was fixed at 256 bytes. A new element of the FILE
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
132 struct (_bufsiz) contains the desired buffer size. This may be
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
133 used as follows:
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
134 <programlisting>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
135 main()
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
136 {
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
137 FILE *fp;
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
138
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
139 fp=fopen("file","r");
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
140 fp->_bufsiz = 1024;
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
141
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
142 .....
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
143 }
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
144 </programlisting>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
145 A few restrictions exist on the use of this parameter.
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
146 Initially the _bufsiz value is 0. The library routines will
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
147 assign a buffer of 256 bytes to the file upon initial read
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
148 or write. If the value is non-zero and the fp has not
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
149 previously been accessed, that value is used as the
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
150 buffersize. Note that due to the way the library routines
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
151 work, once a buffer of a given size is allocated to an fp, a
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
152 larger size cannot be used, even if the file is closed. Note
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
153 that the buffers are allocated from the ibrk() so enough extra
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
154 memory must be allocated by the linker to handle the bigger
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
155 buffers.
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
156 </para>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
157 <para>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
158 Since the size of the _iobuf struct (FILE) in stdio.h has
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
159 changed, all .r files must be re-compiled using the new header
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
160 file.
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
161 </para>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
162 <para>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
163 Cstart.r can now handle direct page data initialization.
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
164 </para>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
165 <para>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
166 Fseek() now does not cause the buffer to be re-filled if the
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
167 seek destination is already in the buffer.
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
168 </para>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
169 <para>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
170 Getc() now does "I$READ" on unbuffered SCF devices rather than
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
171 "I$READLN".
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
172 </para>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
173 <para>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
174 Getc() performed on "stdin" flushes the "stdout" buffer.
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
175 </para>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
176 <para>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
177 Printf() has been changed to not flush the "stdout" buffer
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
178 before returning.
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
179 </para>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
180 <para>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
181 Chown() has been fixed to not wipe out disks.
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
182 </para>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
183 <para>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
184 Toascii() has been added to stdio.h
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
185 </para>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
186 <para>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
187 Calls to scanf() now do not cause the linker to reports
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
188 unresolved references to toupper() and tolower().
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
189 </para>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
190 <para>
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
191 The floating point routines now report errors 40, 41, and 42
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
192 for floating point over/underflow, divide by zero, and
17b517997c7a Finished the intro notice
roug
parents: 532
diff changeset
193 float/long conversion instead of error #007.
532
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
194 </para>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
195 </listitem>
72f3c79b0674 Mainly section structures added.
roug
parents: 468
diff changeset
196 </varlistentry>
468
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
197
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
198 </variablelist>
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
199 </preface>