Skip to content

[SR-737] [dispatch] dispatch_queue_create has wrong return type #755

@drewcrawford

Description

@drewcrawford
Previous ID SR-737
Radar None
Original Reporter @drewcrawford
Type Bug
Status Resolved
Resolution Won't Do
Environment

Linux x64
swift-DEVELOPMENT-SNAPSHOT-2016-02-08-a

Additional Detail from JIRA
Votes 0
Component/s libdispatch
Labels Bug
Assignee dgrove-oss (JIRA)
Priority Medium

md5: e7691fb73226e77e3cd6b0d9ebce19d7

Issue Description:

dispatch_queue_create on Linux has return type of COpaquePointer whereas a return type of dispatch_queue_t! is expected.

To reproduce in my Docker image:

$ docker run -it --privileged=true drewcrawford/swift:swift-DEVELOPMENT-SNAPSHOT-2016-02-08-a
$ swift -Xcc -fblocks -L/usr/local/lib -I /usr/local/include/dispatch/haxx -lBlocksRuntime -L/usr/lib/x86_64-linux-gnu
Welcome to Swift version 3.0-dev (LLVM a7663bb722, Clang 4ca3c7fa28, Swift c130b422a9). Type :help for assistance.
  1> import Dispatch
  2> let q = dispatch_queue_create("foo", DISPATCH_QUEUE_SERIAL)
q: dispatch_queue_t = 0x0000000000603050 -> 0x00007ffff442a6a0 libdispatch.so`_dispatch_queue_vtable
  3> dispatch_suspend(q)

Expected results: success

Actual results:

repl.swift:3:18: error: cannot convert value of type 'dispatch_queue_t' (aka 'COpaquePointer') to expected argument type 'dispatch_object_t'
dispatch_suspend(q)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions