Uploaded image for project: 'Swift'
  1. Swift
  2. SR-737

[dispatch] dispatch_queue_create has wrong return type

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Won't Do
    • Component/s: libdispatch
    • Labels:
      None
    • Environment:

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

      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)
      

        Attachments

          Activity

            People

            Assignee:
            dgrove-oss David Grove
            Reporter:
            drewcrawford Drew Crawford
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: