@@ -51,9 +51,9 @@ $(H2 $(LNAME2 command-line, Invoking ImportC))
51
51
$(LI indirectly via importing a C file)
52
52
)
53
53
54
- $(H3 ImportC Files on the Command Line)
54
+ $(H3 $(LNAME2 command-line, ImportC Files on the Command Line) )
55
55
56
- $(H3 Importing C Files)
56
+ $(H3 $(LNAME2 importing, Importing C Files) )
57
57
58
58
59
59
$(H2 $(LNAME2 preprocessor, Preprocessor))
@@ -97,6 +97,7 @@ $(H2 $(LNAME2 preprocessor, Preprocessor))
97
97
98
98
$(P and the preprocessed output is written to $(TT file.i).)
99
99
100
+
100
101
$(H2 $(LNAME2 preprocessor-directives, Preprocessor Directives))
101
102
102
103
$(P Nevertheless, ImportC supports these preprocessor directives:)
@@ -110,20 +111,62 @@ $(H2 $(LNAME2 preprocessor-directives, Preprocessor Directives))
110
111
$(P $(LINK2 https://gcc.gnu.org/onlinedocs/gcc-11.1.0/cpp/Preprocessor-Output.html, linemarker)
111
112
directives are normally embedded in the output of C preprocessors.)
112
113
114
+
113
115
$(H2 $(LNAME2 limitations, Limitations))
114
116
115
117
$(H3 $(LNAME2 exceptions, Exception Handling))
116
118
117
119
$(P ImportC is assumed to never throw exceptions. `setjmp` and `longjmp` are not supported.)
118
120
119
- $(H3 $(LNAME2 const, Transitive Const))
121
+ $(H3 $(LNAME2 const, Const))
120
122
121
123
$(P C11 specifies that `const` only applies locally. `const` in ImportC applies transitively,
122
124
meaning that although $(CCODE int *const p;) means in C11 that p is a const pointer to int,
123
125
in ImportC it means p is a const pointer to a const int.)
124
126
127
+ $(H3 $(LNAME2 volatile, Volatile))
128
+
129
+ $(P The `volatile` type-qualifier (C11 6.7.3) is ignored. Use of `volatile` to implement shared
130
+ memory access is unlikely to work anyway, $(LINK2 #_atomic, _Atomic) is for that.
131
+ To use `volatile` as a device register, call a function to do it that is compiled separately,
132
+ or use inline assembler.
133
+ )
134
+
135
+ $(H3 $(LNAME2 restrict, Restrict))
136
+
137
+ $(P The `restrict` type-qualifier (C11 6.7.3) is ignored.)
138
+
139
+ $(H3 $(LNAME2 _atomic, _Atomic))
140
+
141
+ $(P The `_Atomic` type-qualifier (C11 6.7.3) is ignored.
142
+ To do atomic operations, use an externally compiled function for that, or the inline assembler.)
143
+
144
+
125
145
$(H2 $(LNAME2 extensions, Extensions))
126
146
147
+ $(H3 $(LNAME2 forward-references, Forward References))
148
+
149
+ $(P Any declarations in scope can be accessed, not just
150
+ declarations that lexically precede a reference.)
151
+
152
+ $(H3 $(LNAME2 ctfe, Compile Time Function Execution))
153
+
154
+ $(P Evaluating constant expressions includes executing functions in the
155
+ same manner as D's CTFE can.)
156
+
157
+ $(H3 $(LNAME2 inlining, Function Inlining))
158
+
159
+ $(P Functions for which the function body is present can
160
+ be inlined by ImportC as well as by the D code that calls them.)
161
+
162
+ $(H3 $(LNAME2 register, Register Storage Class))
163
+
164
+ $(P Objects with `register` storage class are treated as `auto` declarations.)
165
+
166
+ $(P Objects with `register` storage class may have their address taken. C11 6.3.2.1-2)
167
+
168
+ $(P Arrays can have `register` storage class, and may be enregistered by the compiler. C11 6.3.2.1-3)
169
+
127
170
128
171
$(H2 $(LNAME2 gnu-clang-extensions, Gnu and Clang Extensions))
129
172
0 commit comments