GNU bug report logs - #11675
stty bad C semantics

Previous Next

Package: coreutils;

Reported by: Edward Schwartz <edmcman <at> cmu.edu>

Date: Mon, 11 Jun 2012 19:27:01 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 11675 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eric Blake <eblake <at> redhat.com>
Cc: Edward Schwartz <edmcman <at> cmu.edu>, 11675 <at> debbugs.gnu.org
Subject: Re: bug#11675: stty bad C semantics
Date: Mon, 11 Jun 2012 13:29:08 -0700
This area is a bit of a mess in the standard, but I think
Edward Schwartz is right that initializers of auto variables
are not guaranteed to clear padding.

As I understand it under Eric Blake's interpretation, a
complete initializer for an auto variable is not guaranteed
to clear the padding, but an incomplete initializer is
guaranteed to do so.  This would be pretty strange.
I think Edward's interpretation of the incomplete-initializer
wording is more likely to be the correct one: namely, that
missing initializers are treated as if they were zero.

Even if the standard was intended to clear the padding,
clearly in practice we have an implementation that doesn't
do so, and it no doubt performs better that way, so I'd say
something like Edward's patch is advisable.




This bug report was last modified 12 years and 342 days ago.

Previous Next


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