@@ -3333,15 +3333,15 @@ fn test_linux(target: &str) {
3333
3333
"Ioctl" if gnu => "unsigned long" . to_string ( ) ,
3334
3334
"Ioctl" => "int" . to_string ( ) ,
3335
3335
3336
- t if is_union => format ! ( "union {}" , t) ,
3337
-
3338
- t if t. ends_with ( "_t" ) => t. to_string ( ) ,
3339
-
3340
3336
// In MUSL `flock64` is a typedef to `flock`.
3341
3337
"flock64" if musl => format ! ( "struct {}" , ty) ,
3342
3338
3339
+ // typedefs don't need any keywords
3340
+ t if t. ends_with ( "_t" ) => t. to_string ( ) ,
3343
3341
// put `struct` in front of all structs:.
3344
3342
t if is_struct => format ! ( "struct {}" , t) ,
3343
+ // put `union` in front of all unions:
3344
+ t if is_union => format ! ( "union {}" , t) ,
3345
3345
3346
3346
t => t. to_string ( ) ,
3347
3347
}
@@ -3390,7 +3390,8 @@ fn test_linux(target: &str) {
3390
3390
// on Linux, this is a volatile int
3391
3391
"pthread_spinlock_t" => true ,
3392
3392
3393
- // For internal use only, to define architecture specific ioctl constants with a libc specific type.
3393
+ // For internal use only, to define architecture specific ioctl constants with a libc
3394
+ // specific type.
3394
3395
"Ioctl" => true ,
3395
3396
3396
3397
// FIXME: requires >= 5.4.1 kernel headers
@@ -3964,6 +3965,13 @@ fn test_linux(target: &str) {
3964
3965
true
3965
3966
}
3966
3967
3968
+ // The `inotify_event` and `cmsghdr` types contain Flexible Array Member fields (the
3969
+ // `name` and `data` fields respectively) which have unspecified calling convention.
3970
+ // The roundtripping tests deliberately pass the structs by value to check "by value"
3971
+ // layout consistency, but this would be UB for the these types.
3972
+ "inotify_event" => true ,
3973
+ "cmsghdr" => true ,
3974
+
3967
3975
// FIXME: the call ABI of max_align_t is incorrect on these platforms:
3968
3976
"max_align_t" if i686 || mips64 || ppc64 => true ,
3969
3977
0 commit comments