mirror of
https://github.com/postgres/postgres.git
synced 2025-08-18 12:22:09 +03:00
Cast to void in StaticAssertExpr, not its callers.
Seems a bit silly that many (in fact all, as of today) uses of StaticAssertExpr would need to cast it to void to avoid warnings from pickier compilers. Let's just do the cast right in the macro, instead. In passing, change StaticAssertExpr to StaticAssertStmt in one place where that seems more apropos. Discussion: https://postgr.es/m/16161.1518715186@sss.pgh.pa.us
This commit is contained in:
@@ -380,10 +380,10 @@ LWLockShmemSize(void)
|
||||
void
|
||||
CreateLWLocks(void)
|
||||
{
|
||||
StaticAssertExpr(LW_VAL_EXCLUSIVE > (uint32) MAX_BACKENDS,
|
||||
StaticAssertStmt(LW_VAL_EXCLUSIVE > (uint32) MAX_BACKENDS,
|
||||
"MAX_BACKENDS too big for lwlock.c");
|
||||
|
||||
StaticAssertExpr(sizeof(LWLock) <= LWLOCK_MINIMAL_SIZE &&
|
||||
StaticAssertStmt(sizeof(LWLock) <= LWLOCK_MINIMAL_SIZE &&
|
||||
sizeof(LWLock) <= LWLOCK_PADDED_SIZE,
|
||||
"Miscalculated LWLock padding");
|
||||
|
||||
|
Reference in New Issue
Block a user