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

Update to Octave version 9 #118

Merged
merged 1 commit into from
Jul 11, 2024
Merged

Conversation

anutosh491
Copy link
Contributor

No description provided.

@@ -539,7 +539,8 @@ std::string plotly_graphics_toolkit::getObjectNumber(
) const
{
double h = o.get_handle().value();
unsigned long id = *reinterpret_cast<unsigned long*>(&h);
unsigned long id;
std::memcpy(&id, &h, sizeof(h));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should be able to do this with a proper reinterpret cast.

Copy link
Contributor Author

@anutosh491 anutosh491 Jul 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah the original thing would do, just had a warning out of it

/home/runner/work/xeus-octave/xeus-octave/src/tk_plotly.cpp:542:23: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  542 |   unsigned long id = *reinterpret_cast<unsigned long*>(&h);
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Hence introduced the change, can revert if required.

Let me revert the change, this can be looked into later too

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep the warning. I think the original code with the double looks like it needs clarification 😄

@SylvainCorlay SylvainCorlay merged commit b7733f3 into jupyter-xeus:main Jul 11, 2024
4 checks passed
@anutosh491 anutosh491 deleted the update branch July 12, 2024 17:32
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

Successfully merging this pull request may close these issues.

2 participants