GNU bug report logs - #55895
[PATCH] maint: Fix ptr_align signature to silence -Wmaybe-uninitialized

Previous Next

Package: coreutils;

Reported by: Anders Kaseorg <andersk <at> mit.edu>

Date: Fri, 10 Jun 2022 22:31:02 UTC

Severity: normal

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Anders Kaseorg <andersk <at> mit.edu>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 55895 <at> debbugs.gnu.org
Subject: bug#55895: [PATCH] maint: Fix ptr_align signature to silence -Wmaybe-uninitialized
Date: Sat, 11 Jun 2022 09:30:28 -0700
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




This bug report was last modified 2 years and 341 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.