added documentation for --model-flat24
[fw/sdcc] / doc / SDCCUdoc-23.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2 <HTML>
3 <HEAD>
4  <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.7">
5  <TITLE>SDCC Compiler User Guide: ANSI-Compliance.</TITLE>
6  <LINK HREF="SDCCUdoc-24.html" REL=next>
7  <LINK HREF="SDCCUdoc-22.html" REL=previous>
8  <LINK HREF="SDCCUdoc.html#toc23" REL=contents>
9 </HEAD>
10 <BODY>
11 <A HREF="SDCCUdoc-24.html">Next</A>
12 <A HREF="SDCCUdoc-22.html">Previous</A>
13 <A HREF="SDCCUdoc.html#toc23">Contents</A>
14 <HR>
15 <H2><A NAME="ANSI_Compliance"></A> <A NAME="s23">23. ANSI-Compliance.</A> </H2>
16
17 <P>Deviations from the compliancy.
18 <P>
19 <OL>
20 <LI>functions are not always reentrant.</LI>
21 <LI>structures cannot be assigned values directly, cannot be passed as function
22 parameters or assigned to each other and cannot be a return value from a function.
23 <PRE>
24 eg
25   
26 </PRE>
27 </LI>
28 </OL>
29 <P>
30 <PRE>
31 struct s { ... }; 
32 struct s s1, s2; 
33 foo() 
34
35 ... 
36 s1 =
37  s2 ; /* is invalid in SDCC although allowed in ANSI */ 
38 ... 
39 }struct s foo1 (struct s parms) /* is invalid in SDCC although allowed in
40  ANSI */ 
41
42 struct s rets; 
43 ... 
44 return rets;/* is invalid in SDCC although
45  allowed in ANSI */ 
46 }
47  
48 </PRE>
49 <P>
50 <OL>
51 <LI>'long long' (64 bit integers) not supported.</LI>
52 <LI>'double' precision floating point not supported.</LI>
53 <LI>integral promotions are suppressed. What does this mean ? The compiler
54 will not implicitly promote an integer expression to a higher order integer,
55 exception is an assignment or parameter passing. </LI>
56 <LI>No support for setjmp and longjmp (for now).</LI>
57 <LI>Old K&amp;R style function declarations are NOT allowed.</LI>
58 </OL>
59 <P>
60 <PRE>
61 foo( i,j) /* this old style of function declarations */ 
62 int i,j; /* are
63  valid in ANSI .. not valid in SDCC */ 
64
65 ... 
66 }
67  
68 </PRE>
69 <P>
70 <OL>
71 <LI>functions declared as pointers must be dereferenced during the call.
72 <PRE>
73 int (*foo)();
74   
75 </PRE>
76 </LI>
77 </OL>
78 <P>
79 <PRE>
80    ... 
81    /* has to be called like this */ 
82    (*foo)();/* ansi standard
83  allows calls to be made like 'foo()' */
84  
85 </PRE>
86 <HR>
87 <A HREF="SDCCUdoc-24.html">Next</A>
88 <A HREF="SDCCUdoc-22.html">Previous</A>
89 <A HREF="SDCCUdoc.html#toc23">Contents</A>
90 </BODY>
91 </HTML>