Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

Conversation

@tmkowalewski
Copy link

@tmkowalewski tmkowalewski commented May 15, 2025

I noticed hdtv would install correctly but failed to compile the binaries it builds against the user's ROOT and Python installations at first launch. After some digging I found that this was because of gcc-15 dropping support for some legacy syntax found in the mfile source code. After making the proposed updates hdtv compiles and appears to work. Definitely check this over beforehand as this was a quick-and-dirty patch by a not-so-experienced dev, I'm not sure what may break (if anything) as a result.

System Details:

  • ROOT 6.34.08
  • Python Python 3.13.3
  • GCC 15.1.1
  • OS: Arch Linux
  • Kernel: Linux 6.14.6-arch1-1

int32_t idx = (((uint32_t)level * mat->lines) + (uint32_t)line) * mat->columns + (uint32_t)col;

memcpy(buffer, dblp + idx, num * sizeof(double));
memcpy((int32_t *)buffer, dblp + idx, (uint32_t)num * sizeof(double));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not introduced in this PR, but this is an obvious type mismatch. Why are we using sizeof(double) to copy data to a (supposedly?) int32_t buffer?

I think this might accidentally work, as long as this is actually a (double*) buffer? At least, the call chain is
mgetdbl → mgetf8f = txt_get, and as far as I can tell, mgetdbl always gets passed a (double*) buffer (as the function name suggests).

So, we have to cast to (double *)buffer here.

int32_t idx = (((uint32_t)level * mat->lines) + (uint32_t)line) * mat->columns + (uint32_t)col;

memcpy(dblp + idx, buffer, num * sizeof(double));
memcpy(dblp + idx, (int32_t *)buffer, (uint32_t)num * sizeof(double));
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should also be a (double *)buffer cast.

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