forked from CObjectSystem/COS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.C89
47 lines (38 loc) · 1.83 KB
/
README.C89
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#
# C Object System
# COS C89 README
#
# Copyright 2007+ Laurent Deniau <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
COS C89 compliance:
-------------------
COS core generates code conform to ISO C89 but it requires a ISO C99 preprocessor.
CosBase (core) can be compiled with a standalone C99 preprocessor and a C89 compiler.
CosStd and other modules require a C99 compiler or a compiler which supports at least
- compound literals (automatic constructors)
- flexible arrays (some class cluster definition like Array)
- 64 bits integers on non 64 bits architectures (class Long)
- complex numbers (class Complex)
- some C99 library functions
Example of CosBase compilation (see CosBase/compile89.sh):
cd CosBase ; make bootstrap ; ./compile89.sh ; ls src/*.[ao]
./compile89.sh clean # remove objects and archive files
Details of compilation on Linux (see CosBase/compile89.sh):
cpp -std=c99 -pedantic -W -Wall -Iinclude -DCOS_C89 -DOSNAME=Linux -E -o src/file.i src/file.c
gcc -std=c89 -pedantic -W -Wall -O3 -c -o obj/file.o src/file.i
- the preprocessing step may generate warnings about the undefinition of __STDC_VERSION__
but usually, standalone preprocessors allow to undef __STDC_VERSION__
Standalone C99 preprocessor:
http://code.google.com/p/ucpp/