Skip to content

Conversation

iluuu1994
Copy link
Member

@iluuu1994 iluuu1994 commented Mar 10, 2023

We're not disabling -fstrict-aliasing so it's better to keep this warning.

We're not disabling -fstrict-aliasing to it's better to keep this warning.
value is a long. mysql_stmt_attr_get() writes to the most significant byte. Type
punning was used to move that byte to the least significant one, which is UB.
We can avoid this by simply casting to my_bool (alias of bool). Previously, a
comparison against 0 should've been done.
@Girgias
Copy link
Member

Girgias commented Mar 10, 2023

Huh, I thought we did, this looks sensible to have if actually do use this optimisation. So LGTM

@iluuu1994 iluuu1994 closed this in f60dc47 Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants