Skip to content

Fix -Wincompatible-pointer-types-discards-qualifiers warning in speedtest1.c#801

Open
hnwyllmm wants to merge 1 commit into
masterfrom
issue/2026052000116213423
Open

Fix -Wincompatible-pointer-types-discards-qualifiers warning in speedtest1.c#801
hnwyllmm wants to merge 1 commit into
masterfrom
issue/2026052000116213423

Conversation

@hnwyllmm
Copy link
Copy Markdown
Member

Description

During compilation of sqlite-benchmark/speedtest1.c, two instances of the -Wincompatible-pointer-types-discards-qualifiers warning are generated.

The function sqlite3_expanded_sql returns a char * (non-const, requiring the caller to free it using sqlite3_free). However, the code uses a const char * to receive this pointer. This leads to discarding the const qualifier when the pointer is later passed to sqlite3_free(void*).

Environment

  • OS: Linux

Related Links

  • DIMA-2026052000116213423

…s in speedtest1.c.

Two -Wincompatible-pointer-types-discards-qualifiers warnings were generated during the compilation of sqlite-benchmark/speedtest1.c. The function sqlite3_expanded_sql returns a `char *` (non-const, requiring the caller to free it with sqlite3_free), but the code was receiving it in a `const char *` variable. This caused a discarding of the const qualifier when passing it to `sqlite3_free(void*)`.
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.

1 participant