-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mx_mysql: Remove faulty errno range check
The assertion mx_assert_return_minus_errno((unsigned int)(int)error == error, ERANGE); does not function as intended, as the conditional expression is optimized away to true by gcc with -O1 and up [1]. While there are alternatives to detect values outside of the range [0..-INT_MIN] that could not be negated into the range [INT_MIN..0], the check appears to be unnecessary. All callers use the MySQL error numbe for comparison with constants. This commit removes the helper functions `mx__mysql_errno()` and `mx__mysql_stmt_errno()` and replaces them with native MySQL calls. [1]: https://godbolt.org/z/1ajK384Ge
- Loading branch information
Showing
1 changed file
with
10 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters