compiler warning in pgcrypto imath.c - Mailing list pgsql-hackers

From Jeff Janes
Subject compiler warning in pgcrypto imath.c
Date
Msg-id CAMkU=1x8taZfsbPkv_MsWbTtzibW_yQHXoMhF_DTtm=z2hVHDg@mail.gmail.com
Whole thread Raw
Responses Re: compiler warning in pgcrypto imath.c
List pgsql-hackers
When compiling on an AWS 64 bit Arm machine, I get this compiler warning:

imath.c: In function 's_ksqr':
imath.c:2590:6: warning: variable 'carry' set but not used [-Wunused-but-set-variable]
      carry;
      ^~~~~

With this version():

PostgreSQL 12devel on aarch64-unknown-linux-gnu, compiled by gcc (Ubuntu/Linaro 7.3.0-27ubuntu1~18.04) 7.3.0, 64-bit

The attached patch adds PG_USED_FOR_ASSERTS_ONLY to silence it.  Perhaps there is a better way, given that we want to change imath.c as little as possible from its upstream? 

Cheers,

Jeff

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Offline enabling/disabling of data checksums
Next
From: Michael Paquier
Date:
Subject: Re: compiler warning in pgcrypto imath.c