diff mbox series

[FFmpeg-devel,2/2] Revert "Disable warnings for casting pointers to integers, there is nothing wrong with that."

Message ID AM7PR03MB66606E4F5F5566D4F474AEE48F9D9@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit 71204e8e3d0ae0b70dcac31ce3a984db79cd4eb0
Headers show
Series [FFmpeg-devel,1/2] av(codec|device): Don't cast pointers to int | expand

Checks

Context Check Description
andriy/commit_msg_x86 warning The first line of the commit message must start with a context terminated by a colon and a space, for example "lavu/opt: " or "doc: ".
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/commit_msg_ppc warning The first line of the commit message must start with a context terminated by a colon and a space, for example "lavu/opt: " or "doc: ".
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Nov. 20, 2021, 4:36 p.m. UTC
This reverts commit 5258f64a14713499cf84840b3ab3a1ee7cdcaeb8.
The premise of said commit (that conversions from pointer to int
are ok) is wrong: C99/C11 6.3.2.3 5: "Any pointer type may be converted
to an integer type. [...] If the result cannot be represented in the
integer type, the behavior is undefined." (C90 6.3.4 contains a similar
restriction.) So don't disable -Wpointer-to-int-cast.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 configure | 1 -
 1 file changed, 1 deletion(-)

Comments

Andreas Rheinhardt Nov. 26, 2021, 6:41 a.m. UTC | #1
Andreas Rheinhardt:
> This reverts commit 5258f64a14713499cf84840b3ab3a1ee7cdcaeb8.
> The premise of said commit (that conversions from pointer to int
> are ok) is wrong: C99/C11 6.3.2.3 5: "Any pointer type may be converted
> to an integer type. [...] If the result cannot be represented in the
> integer type, the behavior is undefined." (C90 6.3.4 contains a similar
> restriction.) So don't disable -Wpointer-to-int-cast.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  configure | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/configure b/configure
> index d068b11073..82e60b5da3 100755
> --- a/configure
> +++ b/configure
> @@ -6903,7 +6903,6 @@ check_cflags -Wwrite-strings
>  check_cflags -Wtype-limits
>  check_cflags -Wundef
>  check_cflags -Wmissing-prototypes
> -check_cflags -Wno-pointer-to-int-cast
>  check_cflags -Wstrict-prototypes
>  check_cflags -Wempty-body
>  
> 

Will apply tonight unless there are objections.

- Andreas
diff mbox series

Patch

diff --git a/configure b/configure
index d068b11073..82e60b5da3 100755
--- a/configure
+++ b/configure
@@ -6903,7 +6903,6 @@  check_cflags -Wwrite-strings
 check_cflags -Wtype-limits
 check_cflags -Wundef
 check_cflags -Wmissing-prototypes
-check_cflags -Wno-pointer-to-int-cast
 check_cflags -Wstrict-prototypes
 check_cflags -Wempty-body