-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
@_silgen_nameFeature → attributes: The @_silgen_name attributeFeature → attributes: The @_silgen_name attributeattributesFeature: Declaration and type attributesFeature: Declaration and type attributesbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.c interopFeature: Interoperability with CFeature: Interoperability with CcompilerThe Swift compiler itselfThe Swift compiler itselfunexpected behaviorBug: Unexpected behavior or incorrect outputBug: Unexpected behavior or incorrect output
Description
In standard library modules, many C functions are imported using the following pattern:
@_silgen_name("_swift_stdlib_getUnsafeArgvArgc")
internal func _swift_stdlib_getUnsafeArgvArgc(_: UnsafeMutablePointer<Int32>)
-> UnsafeMutablePointer<UnsafeMutablePointer<Int8>?>
not followed by a function body. This is special-cased by the compiler.
Functions imported this way do not benefit from the SE-0324 relaxed pointer semantics. They should have the same affordance as other C functions. This pattern also appears with the @objc
attribute, but much more rarely than with @_silgen_name
.
Tracked as rdar://114794258
Metadata
Metadata
Assignees
Labels
@_silgen_nameFeature → attributes: The @_silgen_name attributeFeature → attributes: The @_silgen_name attributeattributesFeature: Declaration and type attributesFeature: Declaration and type attributesbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.c interopFeature: Interoperability with CFeature: Interoperability with CcompilerThe Swift compiler itselfThe Swift compiler itselfunexpected behaviorBug: Unexpected behavior or incorrect outputBug: Unexpected behavior or incorrect output