Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
V
VisualizationLibrary
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1
    • Issues 1
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • CMIC
  • VisualizationLibrary
  • Issues
  • #5

Closed
Open
Opened Nov 11, 2015 by Miklos Espak@mespak

Examples do not build on Mac with clang

The errors I get:

/Users/gitlab-runner/src/niftk-ep/VL/3659c/src/src/examples/Applets/App_PolygonReduction.cpp:44:39: error: non-constant-expression cannot be narrowed from type 'double' to 'float'
      in initializer list [-Wc++11-narrowing]
static const float ratios[] = { 1.0f, 1.0f / pow(golden, 1), 1.0f / pow(golden, 2), 1.0f / pow(golden, 3), 1.0f / pow(golden, 4), 1.0f / pow(golden, 5) };
                                      ^~~~~~~~~~~~~~~~~~~~~
/Users/gitlab-runner/src/niftk-ep/VL/3659c/src/src/examples/Applets/App_PolygonReduction.cpp:44:39: note: insert an explicit cast to silence this issue
static const float ratios[] = { 1.0f, 1.0f / pow(golden, 1), 1.0f / pow(golden, 2), 1.0f / pow(golden, 3), 1.0f / pow(golden, 4), 1.0f / pow(golden, 5) };
                                      ^~~~~~~~~~~~~~~~~~~~~
                                      static_cast<float>(  )
/Users/gitlab-runner/src/niftk-ep/VL/3659c/src/src/examples/Applets/App_PolygonReduction.cpp:44:62: error: non-constant-expression cannot be narrowed from type 'double' to 'float'
      in initializer list [-Wc++11-narrowing]
static const float ratios[] = { 1.0f, 1.0f / pow(golden, 1), 1.0f / pow(golden, 2), 1.0f / pow(golden, 3), 1.0f / pow(golden, 4), 1.0f / pow(golden, 5) };
                                                             ^~~~~~~~~~~~~~~~~~~~~
/Users/gitlab-runner/src/niftk-ep/VL/3659c/src/src/examples/Applets/App_PolygonReduction.cpp:44:62: note: insert an explicit cast to silence this issue
static const float ratios[] = { 1.0f, 1.0f / pow(golden, 1), 1.0f / pow(golden, 2), 1.0f / pow(golden, 3), 1.0f / pow(golden, 4), 1.0f / pow(golden, 5) };
                                                             ^~~~~~~~~~~~~~~~~~~~~
                                                             static_cast<float>(  )
/Users/gitlab-runner/src/niftk-ep/VL/3659c/src/src/examples/Applets/App_PolygonReduction.cpp:44:85: error: non-constant-expression cannot be narrowed from type 'double' to 'float'
      in initializer list [-Wc++11-narrowing]
static const float ratios[] = { 1.0f, 1.0f / pow(golden, 1), 1.0f / pow(golden, 2), 1.0f / pow(golden, 3), 1.0f / pow(golden, 4), 1.0f / pow(golden, 5) };
                                                                                    ^~~~~~~~~~~~~~~~~~~~~
/Users/gitlab-runner/src/niftk-ep/VL/3659c/src/src/examples/Applets/App_PolygonReduction.cpp:44:85: note: insert an explicit cast to silence this issue
static const float ratios[] = { 1.0f, 1.0f / pow(golden, 1), 1.0f / pow(golden, 2), 1.0f / pow(golden, 3), 1.0f / pow(golden, 4), 1.0f / pow(golden, 5) };
                                                                                    ^~~~~~~~~~~~~~~~~~~~~
                                                                                    static_cast<float>(  )
/Users/gitlab-runner/src/niftk-ep/VL/3659c/src/src/examples/Applets/App_PolygonReduction.cpp:44:108: error: non-constant-expression cannot be narrowed from type 'double' to 'float'
      in initializer list [-Wc++11-narrowing]
static const float ratios[] = { 1.0f, 1.0f / pow(golden, 1), 1.0f / pow(golden, 2), 1.0f / pow(golden, 3), 1.0f / pow(golden, 4), 1.0f / pow(golden, 5) };
                                                                                                           ^~~~~~~~~~~~~~~~~~~~~
/Users/gitlab-runner/src/niftk-ep/VL/3659c/src/src/examples/Applets/App_PolygonReduction.cpp:44:108: note: insert an explicit cast to silence this issue
static const float ratios[] = { 1.0f, 1.0f / pow(golden, 1), 1.0f / pow(golden, 2), 1.0f / pow(golden, 3), 1.0f / pow(golden, 4), 1.0f / pow(golden, 5) };
                                                                                                           ^~~~~~~~~~~~~~~~~~~~~
                                                                                                           static_cast<float>(  )
/Users/gitlab-runner/src/niftk-ep/VL/3659c/src/src/examples/Applets/App_PolygonReduction.cpp:44:131: error: non-constant-expression cannot be narrowed from type 'double' to 'float'
      in initializer list [-Wc++11-narrowing]
static const float ratios[] = { 1.0f, 1.0f / pow(golden, 1), 1.0f / pow(golden, 2), 1.0f / pow(golden, 3), 1.0f / pow(golden, 4), 1.0f / pow(golden, 5) };
                                                                                                                                  ^~~~~~~~~~~~~~~~~~~~~
/Users/gitlab-runner/src/niftk-ep/VL/3659c/src/src/examples/Applets/App_PolygonReduction.cpp:44:131: note: insert an explicit cast to silence this issue
static const float ratios[] = { 1.0f, 1.0f / pow(golden, 1), 1.0f / pow(golden, 2), 1.0f / pow(golden, 3), 1.0f / pow(golden, 4), 1.0f / pow(golden, 5) };
                                                                                                                                  ^~~~~~~~~~~~~~~~~~~~~
                                                                                                                                  static_cast<float>(  )
5 errors generated.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: CMIC/VisualizationLibrary#5