@@ -151,6 +151,27 @@ $(H2 $(LNAME2 limitations, Limitations))
151
151
$(P The `_Atomic` type-qualifier (C11 6.7.3) is ignored.
152
152
To do atomic operations, use an externally compiled function for that, or the inline assembler.)
153
153
154
+ $(H3 $(LNAME2 compatible_types, Compatible Types))
155
+
156
+ $(P $(I Compatible Types) (C11 6.7.2) are identical types in ImportC.)
157
+
158
+ $(H3 $(LNAME2 same_only_different, Same only Different Types))
159
+
160
+ $(P On some platforms, C `long` and `unsigned long` are the same size as `int` and `unsigned int`, respectively.
161
+ On other platforms, C `long` and `unsigned long` are the same size as `long long` and `unsigned long long`.
162
+ `long double` and `long double _Complex` can be same size as `double` and `double _Complex`.
163
+ In ImportC, these types that are the same size and signed-ness are treated as the same types.
164
+ )
165
+
166
+ $(H3 $(LNAME2 _generic, _Generic))
167
+
168
+ $(P $(B Generic selection) expressions (C11 6.5.1.1) differ from ImportC.
169
+ The types in $(LINK2 #same_only_different, Same only Different Types) are
170
+ indistinguishable in the $(I type-name) parts of $(I generic-association).
171
+ Instead of giving an error for duplicate types per C11 6.5.1.1-2, ImportC
172
+ will select the first compatible $(I type-name) in the $(I generic-assoc-list).
173
+ )
174
+
154
175
155
176
$(H2 $(LNAME2 extensions, Extensions))
156
177
@@ -190,10 +211,10 @@ $(H2 $(LNAME2 gnu-clang-extensions, Gnu and Clang Extensions))
190
211
not part of the function's type. In D, a function that never returns
191
212
has the return type `noreturn`. The difference can be seen with the
192
213
code:)
193
- ---
214
+ $(CCODE
194
215
attribute((noreturn)) int foo();
195
216
size_t x = sizeof(foo());
196
- ---
217
+ )
197
218
$(P This code is accepted by `gcc`, but makes no sense for D. Hence,
198
219
although it works in ImportC, it is not representable as D code,
199
220
meaning one must use judgement in creating a .di file to interface
0 commit comments