Copy link
@maksimu

maksimu Dec 21, 2023

@dlenski Getting below warning/error on this line.

/root/mariadb-connector-c/mariadb-connector-c/libmariadb/mariadb_lib.c:244:38: error: suggest parentheses around '&&' within '||' [-Werror=parentheses]
       if (last_errno >= CR_MIN_ERROR && last_errno <= CR_MAX_ERROR ||

The warning suggests that the mix of && and || without explicit parentheses can be confusing or lead to unintended behavior. To resolve this, you can group the conditions that should be evaluated together using parentheses. The corrected line should be:

if ((last_errno >= CR_MIN_ERROR && last_errno <= CR_MAX_ERROR) ||
    (last_errno >= CER_MIN_ERROR && last_errno <= CER_MAX_ERROR))