Skip to content
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

constexpr build failure on clang #108

Closed
rokups opened this issue May 11, 2018 · 4 comments
Closed

constexpr build failure on clang #108

rokups opened this issue May 11, 2018 · 4 comments
Assignees
Labels
bug core Issues related to easy_profiler_core resolved

Comments

@rokups
Copy link
Contributor

rokups commented May 11, 2018

In file included from /home/travis/build/rokups/Urho3D/Source/ThirdParty/easy_profiler/easy_profiler_core/include/easy/details/arbitrary_value_public_types.h:46:
/home/travis/build/rokups/Urho3D/Source/ThirdParty/easy_profiler/easy_profiler_core/include/easy/details/arbitrary_value_aux.h:70:44: error: 
      constexpr constructor never produces a constant expression
      [-Winvalid-constexpr]
        explicit inline EASY_CONSTEXPR_FCN ValueId(const void* _member) ...
                                           ^
/home/travis/build/rokups/Urho3D/Source/ThirdParty/easy_profiler/easy_profiler_core/include/easy/details/arbitrary_value_aux.h:70:80: note: 
      reinterpret_cast is not allowed in a constant expression
  ...inline EASY_CONSTEXPR_FCN ValueId(const void* _member) : m_id(reinterpre...

For time being i removed EASY_CONSTEXPR_FCN. Not sure if this is a proper fix or what proper fix would be.

@rationalcoder
Copy link
Contributor

That's probably the right thing to do. Clang is right according to the standard. reinterpret_cast and any casting business with void* 's isn't allowed in constexpr anything.

@cas4ey
Copy link
Collaborator

cas4ey commented May 15, 2018

Hi @rokups !
Yeah, my bad :-)

Can you try to replace vin_t in ValueId with const void* for ValueId::m_id and cast it to number only during serialization here (replace _vin.m_id with reinterpret_cast<profiler::vin_t>(_vin.m_id) // Edit: or even with static_cast<profiler::vin_t>(reinterpret_cast<uintptr_t>(_vin.m_id));) ?

If this would not work then yes, EASY_CONSTEXPR_FCN should be removed from ValueId constructor :<

@cas4ey cas4ey added the bug label May 15, 2018
@cas4ey cas4ey modified the milestones: Release v2.1.0, Release v2.0.1 May 15, 2018
@rokups
Copy link
Contributor Author

rokups commented May 15, 2018

@cas4ey clang approves change you suggested :)

@cas4ey
Copy link
Collaborator

cas4ey commented May 15, 2018

Closing for now. Let me know if any problems occur.

@cas4ey cas4ey closed this as completed May 15, 2018
@cas4ey cas4ey added the core Issues related to easy_profiler_core label May 30, 2018
cas4ey added a commit that referenced this issue Jun 14, 2018
v2.0.1: Clang build fix, high-dpi displays fix, minor fixes

* (#108) Fixed Clang build
* (#89) Fixed scaling for high-dpi displays + respecting explicitly set font scaling (Windows)
* Fixed histogram scaling when using mouse wheel
* Updated UI style
manimax3 added a commit to manimax3/easy_profiler that referenced this issue Jun 29, 2018
* yse#31 intermediate commit: added basic API for arbitrary values profiling. Still not working.

* yse#31 build fix

* yse#31 added arbitrary value id

* yse#75 Windows build

(cherry picked from commit ec720bf)

* #0 [Core] Added constexpr support macros and refactored extract_... functions

* yse#31 [Core] further work on arbitrary values

* #0 [Core] Rearranged include files

* #0 [Core] A lot of code refactoring

* #0 [Core][GUI] refactoring

* #0 [Core] refactoring

* #0 [Core] Windows build

* #0 Windows build

* #0 Build fix >:E

* yse#31 Single arbitrary values can be displayed in GUI as events + value converted to text

* #0 [GUI] Styling

* #0 [GUI] Styling

* #0 MSVC2013 build

* #0 [GUI] Warning fix: typo, forgotten return

* #0 [GUI] Styling

* yse#31 arbitrary value interface small refactoring

* #0 [GUI] Styling

* #0 [GUI] Styling

* #0 [GUI] Styling. Themes.

* #0 [GUI] Styling and optimization

* #0 [GUI] Windows styling and consterxpr fix for some Qt versions

* yse#81 [Core] Added an option to choose function names format

* yse#31 [GUI] Arbitrary values viewer progress

* #0 [GUI] Appearance progress

* yse#31 [GUI] Arbitrary values viewer progress

* #0 [GUI] Appearance

* #0 [GUI] HierarchyTree: Finally replaced colored rows with colored squares in front of block name. These squares can not be turned off from now.

* yse#31 [GUI] Arbitrary values viewer begin. Refactoring.

* yse#31 [Core] Fixed issue with storing arbitrary value while dumping. // [GUI] Further values viewer progress.

* Sample: build when SAMPLE_NETWORK_TEST is undefined

* minor refactoring

* yse#31 Basic arbitrary values viewer chart

* Windows build

* Older compiler build

* Older compiler build

* yse#75 [Core] No more waiting behavior when dumping blocks. Current solution resolves possible dead-lock but restricts any Events out of Frame bounds (You can see that the last event for LoadingResources thread in the profiler_sample is always absent).

* Install with include hierarhy

* yse#75 [Core] No waiting when dumping blocks. All events should now be stored properly.

* Release 2.0 further work. Intermediate commit.

* yse#31 [Gui] Big update for arbitrary values viewer. It is now viable and can be used to inspect user metrics. Currently arbitrary values viewer is built into blocks list widget.

* #0 [Gui] Saving dialog geometry; Added refresh button to arbitrary values widget; Fixed zoom-in algorithm

* yse#31 [Gui] Arbitrary values viewer bug fixes

* #0 [Gui] Large portion of refactoring; Replaced bunch of threads with thread pool; Small fixes for arbitrary values viewer

* #0 Updated copyright dates; [Gui] thread_pool.cpp MSVC build fix; [Core] Renamed getCurrentTime() to profiler::clock::now() + renamed profiler::currentTime() to profiler::now()

* #0 Simplified some lambdas

* yse#89 Trying to fix high-dpi displays problem

* yse#31 [Gui] Intermediate commit: implementing O(n) chart (kinda...) to be able to analyse algorithm complexity depending on certain arbitrary value

* yse#31 [Gui] Complexity charts for arbitrary value viewer

* yse#31 [Gui] Hide slider when displaying complexity chart

* yse#31 [Gui] Arbitrary values viewer: fixed performance problem, added icons for chart types

* yse#31 [Gui] Fixed mouse indicator for complexity chart; fixed buildTree(); added stub for future export values to .csv

* #0 [Gui] Fixed popup and double click on thread names on Diagram

* yse#31 [Gui] Fixed appox. line painting for complexity chart; Added export to .csv for regular chart type (timestamp;value);

* #0 [Gui] Paint background for current item for tree-widget

* Add math functions for calculation complexity

* yse#67 [Converter] Build fix after merging to release_2_0

* #0 [Gui] TreeView style fixes

* #0 [Gui] Thread pool fix: there was a possibility that not all tasks would be executed

* #0 [Gui] Added background jobs to thread pool and removed detached threads from code

* yse#31 [Gui] Implemented zoom for complexity chart mode; Implemented export to .csv for complexity mode

* #0 [Gui] Mac build fix

* #0 [Gui] Fixed typo

* #0 [Gui] Windows styling fix

* yse#31 [Core] Arbitrary values: replaced size_t with uint16_t; [Gui] Added support of arrays to arbitrary values tree

* #0 [Gui] Fixed hierarchy building for zero duration blocks - events and arbitrary values are always visible

* yse#31 [Gui] Double click on arbitrary value on the Diagram will open values viewer and will select appropriate arbitrary value

* yse#31 [UI] Open several arbitrary values viewer windows

* yse#31 [UI] Arbitrary values: fixed multi-window viewer

* yse#31 [UI] Highlight current selected block boundaries on arbitrary value chart

* yse#31 [UI] Fixed current block boundaries painting

* #0 [UI] Added viewport info widget. See [Settings] -> [See viewport info]

* yse#100 [UI] Implemented zoom-in button

* #0 [UI] Adjusted search boxes in Hierarchy widget and Blocks Descriptors Widget

* yse#31 [UI] Added arbitrary value tool-tip to Hierarchy tree widget (Try to move mouse cursor over Name column)

* yse#31 [UI] Added tooltip for arbitrary values to the Diagram

* yse#31 [UI] Amend. Forgotten files.

* #0 [UI] Diagram tool-tips fix: no tool-tips if mouse cursor is over another widget (opened settings for example)

* #0 [UI] Arbitrary value ToolTip styling fix; Viewport info fix;

* yse#48 [Core] Rearranged file header members order to minimize padding;
[Core] Changed version to 2.0.0;

* #0 Update README.md

* yse#67 [Converter] Rewrote json converter, arbitrary values would be added soon

* yse#91 [UI] Added snapshot tool stub; Working on saving blocks to file from UI

* yse#91 [UI] Snapshot feature further progress (intermediate commit)

* yse#91 [UI] Snapshot icon (actually called "crop")

* #0 [core] installing profiler_converter

* yse#91 [UI] .prof serializator (intermediate commit)

* yse#91 [Core][UI] functions profiler::writeTreesToFile(), profiler::writeTreesToStream() are now working. Snapshot feature is now working: select an area on Diagram (with right mouse button or double-click) and press Snapshot button to save it to separate file.

* #0 [Sample] Rollback - profiler_sample is standalone again (do not need to connect gui)

* #0 Update readme

* #0 Added new UI image to README.md

* Update README.md

* #0 [Core] refactoring

* #0 [UI] refactoring

* #0 [Core] Windows build

* #0 [Core] refactoring

* #0 [Core] findRange() fix for writeTreesToStream()

* #0 [Core] fixed typo

* yse#108 fix [Core] clang build for arbitrary values

* #0 [UI] Tooltip fix

* yse#89 [UI] High DPI displays fix + System scaling factor

* # [UI] Styles and refactoring

* #0 [UI] UI styles

* #0 [Misc] modified gitignore

* #0 [UI] Style

* #0 [UI] refactoring

* #0 [UI] Fixed zooming for charts (histogram, arbitrary value) with mouse wheel

* #0 [Misc] Update README.md

* #0 Updated image in README.md

* yse#106 [Core][UI] Added possibility to add user bookmarks with double-clicking on a timeline in the Diagram window.
yse#112 [UI] Fixed losing focus (and getting under MainWindow) for Blocks widget.
#0 [UI] UI styling, added custom window header and dialogs (could be turned off/on and adjusted position at [Settings -> Appearance] menu).

* yse#106 [UI] Rising a tooltip when passing cursor over a bookmark; #0 [UI] Minor fixes

* yse#106 [Core][UI] Fixed reading bookmarks with empty text; Fixed overriding and restoring mouse cursor shape when hovering bookmark at the Diagram widget;
#0 [UI] Waiting until saving file is finished when closing the UI.

* Update README.md

* Update README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug core Issues related to easy_profiler_core resolved
Projects
None yet
Development

No branches or pull requests

3 participants