diff mbox

[FFmpeg-devel] doc/developer: Add terse documentation of assumed C implementation defined behavior

Message ID 20170428005042.18375-1-michael@niedermayer.cc
State Accepted
Headers show

Commit Message

Michael Niedermayer April 28, 2017, 12:50 a.m. UTC
Suggested-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 doc/developer.texi | 5 +++++
 1 file changed, 5 insertions(+)

Comments

wm4 April 28, 2017, 10:52 a.m. UTC | #1
On Fri, 28 Apr 2017 02:50:42 +0200
Michael Niedermayer <michael@niedermayer.cc> wrote:

> Suggested-by: "Ronald S. Bultje" <rsbultje@gmail.com>
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  doc/developer.texi | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/doc/developer.texi b/doc/developer.texi
> index dbe1f5421f..a948113792 100644
> --- a/doc/developer.texi
> +++ b/doc/developer.texi
> @@ -131,6 +131,11 @@ designated struct initializers (@samp{struct s x = @{ .i = 17 @};});
>  
>  @item
>  compound literals (@samp{x = (struct s) @{ 17, 23 @};}).
> +
> +@item
> +Implementation defined behavior for signed integers is assumed to match the
> +expected for Twos complement. Non representable values in integer casts are binary

Patch is ok, but "the expected for Twos complement" sounds a bit weird.
Maybe "expected behavior"? Also "two's complement".

> +truncated. Shift right of signed values uses sign extension.
>  @end itemize
>  
>  These features are supported by all compilers we care about, so we will not
Michael Niedermayer May 1, 2017, 3:59 p.m. UTC | #2
On Fri, Apr 28, 2017 at 12:52:45PM +0200, wm4 wrote:
> On Fri, 28 Apr 2017 02:50:42 +0200
> Michael Niedermayer <michael@niedermayer.cc> wrote:
> 
> > Suggested-by: "Ronald S. Bultje" <rsbultje@gmail.com>
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  doc/developer.texi | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/doc/developer.texi b/doc/developer.texi
> > index dbe1f5421f..a948113792 100644
> > --- a/doc/developer.texi
> > +++ b/doc/developer.texi
> > @@ -131,6 +131,11 @@ designated struct initializers (@samp{struct s x = @{ .i = 17 @};});
> >  
> >  @item
> >  compound literals (@samp{x = (struct s) @{ 17, 23 @};}).
> > +
> > +@item
> > +Implementation defined behavior for signed integers is assumed to match the
> > +expected for Twos complement. Non representable values in integer casts are binary
> 
> Patch is ok, but "the expected for Twos complement" sounds a bit weird.
> Maybe "expected behavior"? Also "two's complement".

applied with these modifications

[...]
diff mbox

Patch

diff --git a/doc/developer.texi b/doc/developer.texi
index dbe1f5421f..a948113792 100644
--- a/doc/developer.texi
+++ b/doc/developer.texi
@@ -131,6 +131,11 @@  designated struct initializers (@samp{struct s x = @{ .i = 17 @};});
 
 @item
 compound literals (@samp{x = (struct s) @{ 17, 23 @};}).
+
+@item
+Implementation defined behavior for signed integers is assumed to match the
+expected for Twos complement. Non representable values in integer casts are binary
+truncated. Shift right of signed values uses sign extension.
 @end itemize
 
 These features are supported by all compilers we care about, so we will not