<div dir="ltr"><div>Hi all,</div><div><br></div><div>I found a bug in my port for MSVC and Cygwin.<br></div><div><br></div><div>The C function swift_stdlib_readLine_stdin() is mapped to &#39;Int&#39; type in Swift, but it generates i32 in LLVM if I specify the target as MSVC. If I give the target as Cygwin, it generates i64.</div><div><br></div><div>With the target options, the Cygwin ported swiftc.exe has the same output.</div><div><br></div><div>I know that the one of the differences between MSVC and Cygwin is the size of &#39;long&#39; type. But I don&#39;t know even if it is related to this problem.</div><div><br></div><div>I don&#39;t know where to I start with.</div><div> </div><div>BEGIN OF tt.swift ---</div><div>import SwiftShims</div><div><br></div><div> var linePtr: UnsafeMutablePointer&lt;CChar&gt;? = nil</div><div> var readBytes = swift_stdlib_readLine_stdin(&amp;linePtr)</div><div> print(readBytes)</div><div>END OF tt.swift -----</div><div><br></div><div>C:\temp&gt;swiftc -emit-ir tt.swift -target x86_64-pc-windows-msvc  | findstr stdlib</div><div>  %4 = call i32 @swift_stdlib_readLine_stdin(i8** bitcast (%Sq* @_Tv2tt7linePtrGSqGSpVs4Int8__ to i8**))</div><div>declare i32 @swift_stdlib_readLine_stdin(i8**) #0</div><div><br></div><div>C:\temp&gt;swiftc -emit-ir tt.swift -target x86_64-unknown-windows-cygnus | findstr stdlib</div><div>  %4 = call i64 @swift_stdlib_readLine_stdin(i8** bitcast (%Sq* @_Tv2tt7linePtrGSqGSpVs4Int8__ to i8**))</div><div>declare i64 @swift_stdlib_readLine_stdin(i8**) #0</div><div><br></div><div><br></div><div>- Han Sangjin</div><div><br></div></div>