summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/gcm.h
diff options
context:
space:
mode:
authorMichael Brown2024-02-10 15:41:29 +0100
committerMichael Brown2024-02-10 15:48:56 +0100
commit94b39fbe9298160b034c93ca06deb39a907e3b3f (patch)
tree2dfc041ae6f3dac2f3444cd6efed768b25b17e17 /src/include/ipxe/gcm.h
parent[libc] Allow build_assert() failures to be ignored via NO_WERROR=1 (diff)
downloadipxe-94b39fbe9298160b034c93ca06deb39a907e3b3f.tar.gz
ipxe-94b39fbe9298160b034c93ca06deb39a907e3b3f.tar.xz
ipxe-94b39fbe9298160b034c93ca06deb39a907e3b3f.zip
[build] Fix build failures with older versions of gcc
Some versions of gcc (observed with gcc 4.8.5 in CentOS 7) will report spurious build_assert() failures for some assertions about structure layouts. There is no clear pattern as to what causes these spurious failures, and the build assertion does succeed in that no unresolvable symbol reference is generated in the compiled code. Adjust the assertions to work around these apparent compiler issues. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/gcm.h')
-rw-r--r--src/include/ipxe/gcm.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/include/ipxe/gcm.h b/src/include/ipxe/gcm.h
index 9653a0a1..4864445d 100644
--- a/src/include/ipxe/gcm.h
+++ b/src/include/ipxe/gcm.h
@@ -89,7 +89,8 @@ static int _gcm_name ## _setkey ( void *ctx, const void *key, \
size_t keylen ) { \
struct _gcm_name ## _context *context = ctx; \
build_assert ( _blocksize == sizeof ( context->gcm.key ) ); \
- build_assert ( ( ( void * ) &context->gcm ) == ctx ); \
+ build_assert ( ( ( void * ) &context->gcm ) == \
+ ( ( void * ) context ) ); \
build_assert ( ( ( void * ) &context->raw ) == \
( ( void * ) context->gcm.raw_ctx ) ); \
return gcm_setkey ( &context->gcm, key, keylen, &_raw_cipher ); \