|
From: | Anders Kaseorg |
Subject: | bug#55895: [PATCH] maint: Fix ptr_align signature to silence -Wmaybe-uninitialized |
Date: | Sat, 11 Jun 2022 09:30:28 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 |
On 6/11/22 09:12, Paul Eggert wrote:
First, a const pointer can point to uninitialized storage.
Of course it can, but my claim was there’s never a reason. A pointer to uninitialized (or zero-initialized) memory that won’t be written is valid but not _useful_. The reason you’d align a pointer is so you can store something there that needs to be aligned. It’s not an accident that all of the current callers work that way.
Anders
[Prev in Thread] | Current Thread | [Next in Thread] |