Skip to content

Compilation warnings with Swift 3.0.2 #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
maximveksler opened this issue Jan 23, 2017 · 1 comment
Closed

Compilation warnings with Swift 3.0.2 #6

maximveksler opened this issue Jan 23, 2017 · 1 comment

Comments

@maximveksler
Copy link

Compiling .Package(url: "https://github.com/GraphQLSwift/GraphQL.git", majorVersion: 0) on Mac.

swift --version
Apple Swift version 3.0.2 (swiftlang-800.0.63 clang-800.0.42.1)
Target: x86_64-apple-macosx10.9

Calling swift build is able to build binary, but produces these warnings:

Compile Swift Module 'GraphQL' (62 sources)
/Users/maximveksler/Project/StreamstagerOrg/Collection/Packages/GraphQL-0.2.8/Sources/GraphQL/Map/Map.swift:759:32: warning: will never be executed
                        string += ","
                               ^
/Users/maximveksler/Project/StreamstagerOrg/Collection/Packages/GraphQL-0.2.8/Sources/GraphQL/Map/Map.swift:756:24: note: condition always evaluates to true
                    if _isDebugAssertConfiguration() {
                       ^
/Users/maximveksler/Project/StreamstagerOrg/Collection/Packages/GraphQL-0.2.8/Sources/GraphQL/Map/Map.swift:768:31: warning: will never be executed
                return string + "]"
                              ^
/Users/maximveksler/Project/StreamstagerOrg/Collection/Packages/GraphQL-0.2.8/Sources/GraphQL/Map/Map.swift:764:16: note: condition always evaluates to true
            if _isDebugAssertConfiguration() {
               ^
/Users/maximveksler/Project/StreamstagerOrg/Collection/Packages/GraphQL-0.2.8/Sources/GraphQL/Map/Map.swift:786:28: warning: will never be executed
                    string += escape(key) + ":" + serialize(map: value)
                           ^
/Users/maximveksler/Project/StreamstagerOrg/Collection/Packages/GraphQL-0.2.8/Sources/GraphQL/Map/Map.swift:781:20: note: condition always evaluates to true
                if _isDebugAssertConfiguration() {
                   ^
/Users/maximveksler/Project/StreamstagerOrg/Collection/Packages/GraphQL-0.2.8/Sources/GraphQL/Map/Map.swift:793:32: warning: will never be executed
                        string += ","
                               ^
/Users/maximveksler/Project/StreamstagerOrg/Collection/Packages/GraphQL-0.2.8/Sources/GraphQL/Map/Map.swift:790:24: note: condition always evaluates to true
                    if _isDebugAssertConfiguration() {
                       ^
/Users/maximveksler/Project/StreamstagerOrg/Collection/Packages/GraphQL-0.2.8/Sources/GraphQL/Map/Map.swift:804:31: warning: will never be executed
                return string + "}"
                              ^
/Users/maximveksler/Project/StreamstagerOrg/Collection/Packages/GraphQL-0.2.8/Sources/GraphQL/Map/Map.swift:800:16: note: condition always evaluates to true
            if _isDebugAssertConfiguration() {
               ^
@paulofaria
Copy link
Member

Those are optimizations for release builds which the compiler doesn't like. I think I'll make the optimizations the default to stop the warnings.

paulofaria pushed a commit that referenced this issue Feb 28, 2017
* fix issue #6 compilation warnings

* update travis ci scripts

* missed _isDebugAssertConfiguration

* add test to debugDescription

* clean warning
paulofaria pushed a commit that referenced this issue May 12, 2017
* fix issue #6 compilation warnings

* update travis ci scripts

* missed _isDebugAssertConfiguration

* add test to debugDescription

* clean warning

* silence warning
paulofaria pushed a commit that referenced this issue Jul 25, 2017
* fix issue #6 compilation warnings

* update travis ci scripts

* missed _isDebugAssertConfiguration

* add test to debugDescription

* clean warning

* silence warning

* added missing test on Linux

* fix failing code on linux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants