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

undefined behivior (in terms of the C standard) in libsql-sqlite3/src/vectorfloat16.c #1915

Open
nevakrien opened this issue Jan 12, 2025 · 0 comments

Comments

@nevakrien
Copy link

I am not sure if this is intentional or not but if it is intentional I would expect some sort of comment documenting why this is the chosen implementation.

so in line 74 IN https://github.com/tursodatabase/libsql/blob/main/libsql-sqlite3/src/vectorfloat16.c#L74
there is a deference of an int pointer as float. In ansi C that's undefined behavior because it breaks strict aliasing.
The situation can be mostly remedied for c99+ by using a union instead of just a u32.

however I dont really have a clean solution for purely ansi C.

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

No branches or pull requests

1 participant