Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: A glitch regarding the usual malloc() idiom Date: Thu, 28 Jul 2016 15:18:30 -0700 Organization: None to speak of Lines: 36 Message-ID: References: <7d995799-5f23-4784-a62e-ea423de00650@googlegroups.com> <36f1e05e-609e-4e0e-8819-86feee1f4d8c@googlegroups.com> <57933a73.4812875@news.xs4all.nl> <5793c8e5.2941812@news.xs4all.nl> <87oa5n97rz.fsf@bsb.me.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="10229"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+s1t+2hGt27NGDiKcfioLa" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:AkUiPtOuPn3FN1KJ5Qd2hERFZHU= sha1:VkSoJo/bsbxaOku7KrmovDSo4/w= Xref: csiph.com comp.lang.c:91283 Tim Rentsch writes: > Keith Thompson writes: [...] >> You make a good point about bit fields (I had pretty much ignored >> them), and the standard probably should acknowledge more explicitly >> that, in the presence of bit fields, padding in structures does not >> necessarily consist only of bytes. But I'm skeptical that the use >> of the phrase "padding bits" in that footnote (with no reference >> to bit fields) was intended to make that point. I think it was >> merely a mistake. (And not a particularly egregious one.) > > Usually I don't think such cases are errors unless there is some > sort of other evidence to support such a conclusion. Here I > don't know of any. Looking at other passages that talk about > padding in structs, to me it looks more likely that "padding > bits" is what is meant here. (This assumes "padding bits" is > understood to mean those bits in a struct or union object > representation that do not participate in the value of any > member.) Certainly that description is more complete than just > saying "padding bytes" need not be copied. Wouldn't you agree? Sure. If the standard is going to use the term "padding bits" for both integer types and structs/unions, IMHO it should be clearer and more consistent about the terminology. Perhaps there's no need for the phrase "padding bytes" at all, and it should just be called "padding". In any case, I don't think anyone outside my killfile really misunderstands the intended meaning. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"