[patch] Add a section about implementation-defined behavior to the user's manual

Nico Weber thakis at chromium.org
Tue Jan 29 17:41:01 PST 2013


On Tue, Jan 29, 2013 at 5:39 PM, Richard Smith <richard at metafoo.co.uk> wrote:
> On Tue, Jan 29, 2013 at 4:47 PM, Nico Weber <thakis at chromium.org> wrote:
>> On Tue, Jan 29, 2013 at 1:00 PM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
>>> On Tue, Jan 29, 2013 at 10:16 PM, Nico Weber <thakis at chromium.org> wrote:
>>>> a coworker asked me if clang documents how it handles right shifts of
>>>> signed numbers today. As far as I can tell there's no documentation
>>>> for this, but I found PR11272 about documenting implementation-defined
>>>> behavior. The bug suggests just linking to gcc's documentation as a
>>>> first step, which is what the attached patch does. This isn't quite
>>>> correct (for example, clang supports UCNs without any flags), but is
>>>> correct for most things. People can fill in more details over time.
>>>
>>> +clang generally matches `gcc's implementation-defined
>>> +behavior <http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/C-Implementation.html#C-Implementation>`.
>>>
>>> Maybe there's a different wording that does not promise too much?  I
>>> can easily see users relying on this (or complaining about Clang's
>>> implementation-defined behavior being different from gcc's).
>>
>> "generally tries to match"? The "generally" sounded fairly
>> weasel-wordy to me already.
>>
>>> What might help is a list of implementation-defined behaviors with
>>> quotations from the standard, as a boilerplate for developers to fill
>>> in.  (It is much easier to write documentation when you know what
>>> exactly you should describe.)
>>
>> I don't have a copy of the standard.
>
> Latest working draft in committee mailing:
>
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3485.pdf
>
> Current working draft:
>
> https://github.com/cplusplus/draft

How similar is this to the list of implementation-defined behavior in
the C standard?



More information about the cfe-commits mailing list