Hi!

On Tue, Jul 02, 2024 at 09:05:14PM -0700, Otto Kekäläinen wrote:
> tests/mysql_client_fw.c
> @@ -1442
> 
> #if defined __x86_64__
>   compile_time_assert(sizeof(MYSQL) == 1272);
> #elif defined __i386__
>   compile_time_assert(sizeof(MYSQL) == 964);
> #endif
> 
> How should I fix this for x32? What is the preprocessor if clause and
> can I safely assume the size is 964?
The comment before this reads
        /*
          this limited check is enough, if sizeof(MYSQL) changes, it changes
          everywhere
        */
so this looks like an ABI stability check,
validating not that MYSQL should be Some Specific Size,
but that it's The Size It Was Last Time.

IMO turn the first line into
  #if defined(__x86_64__) && !defined(__ILP32__)
since they did actually just want to check
if the size is the same they measured on amd64 and i386.

And if it were to change on either of these two,
it would change everywhere (apparently).

Best,

Attachment: signature.asc
Description: PGP signature

Reply via email to