Skip to content

Conversation

@laurensvalk
Copy link
Member

@laurensvalk laurensvalk commented Dec 22, 2025

This broke in newer GCC versions, causing the LED to get the wrong color.

Fixes pybricks/support#2497

Edit: Maybe this isn't the technically correct terminology for this error. It would be nice if we could catch these automatically.

@coveralls
Copy link

coveralls commented Dec 22, 2025

Coverage Status

coverage: 55.816%. remained the same
when pulling 9b8c514 on issue-2497
into 22c6e47 on master.

@dlech
Copy link
Member

dlech commented Dec 22, 2025

Maybe this isn't the technically correct terminology for this error

I think "type punning" is the term you are looking for.

It would be nice if we could catch these automatically.

GCC does have a warning for this, but char * is an exception and is supposed to be safe. (uint8_t is unsigned char so likely wouldn't trigger the warning.)

So sounds more like a bug in GCC or the packed attribute invalidates the safeness of char *.

This broke in newer GCC versions, causing the LED to get the wrong color.

Fixes pybricks/support#2497
@laurensvalk laurensvalk merged commit 9b8c514 into master Dec 23, 2025
30 checks passed
@dlech dlech deleted the issue-2497 branch December 23, 2025 19:11
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.

[Bug] Lego Remote Light not working on latest Prime Hub update

4 participants