Open kasperk81 opened 3 years ago
@timotheecour do you have any ideas where the fix of this one should go?
Note: I looked at this a bit yesterday but, not being familiar with Nim, I was unable to figure out whether the problem was coming just from the tests, or from part of the Nim standard library that could also affect applications.
Type FILE is imported as incomplete structs in two places: https://github.com/nim-lang/Nim/blob/9d3a813fb96950631c69858e8e26b6503abd02fe/lib/system/io.nim#L18-L20
https://github.com/nim-lang/Nim/blob/fb86271556b4ea4485195febaa02b972149ca088/lib/system/ansi_c.nim#L117-L119
However the compiler/cgen does not make distinction when choosing the ctypes to emit. This assumption that FILE "can be" complete struct (regardless of what C standard says and how nim itself imports it; abstract / incomplete struct) naturally does NOT hold in non-GNU environments which abide by the meaning of "incomplete struct".
Consequently, a test fails on Alpine Linux, musl-libc: