diff mbox

[FFmpeg-devel] configure: Add -Wno-char-subscripts

Message ID CAB0OVGroDU0eyva3KN9mwnKQ3utW_xQCcbUHSDZrSHJcMSiUrg@mail.gmail.com
State Accepted
Headers show

Commit Message

Carl Eugen Hoyos Nov. 18, 2018, 3:40 a.m. UTC
Hi!

On systems with signed char, the compiler cannot distinguish between
(intended) int8_t used as subscript and unintended char, therefore the
warning doesn't help.

Please comment, Carl Eugen

Comments

Tomas Härdin Nov. 18, 2018, 10:25 p.m. UTC | #1
sön 2018-11-18 klockan 04:40 +0100 skrev Carl Eugen Hoyos:
> Hi!
> 
> On systems with signed char, the compiler cannot distinguish between
> (intended) int8_t used as subscript and unintended char, therefore the
> warning doesn't help.

Is this done anywhere in the codebase currently? Either way, probably a
good idea

/Toams
Carl Eugen Hoyos Nov. 19, 2018, 12:56 a.m. UTC | #2
2018-11-18 23:25 GMT+01:00, Tomas Härdin <tjoppen@acc.umu.se>:
> sön 2018-11-18 klockan 04:40 +0100 skrev Carl Eugen Hoyos:
>> Hi!
>>
>> On systems with signed char, the compiler cannot distinguish between
>> (intended) int8_t used as subscript and unintended char, therefore the
>> warning doesn't help.
>
> Is this done anywhere in the codebase currently?

Not sure I understand correctly:
I don't think there is a "char" used as subscript (or we would see the
warning on standard x86 Linux systems), I suspect the "uint8_t" we
often use as subscripts are translated into "unsigned char" and
never trigger the warning but - afaict from looking at the code and
the many warnings on sunos - wherever FFmpeg uses "int8_t" as
subscript (which happens often in the code and I assume it happens
intentionally) the warning shows because of a translation into "char"
on such a system where char is signed.

Carl Eugen
Carl Eugen Hoyos Nov. 24, 2018, 11:40 p.m. UTC | #3
2018-11-18 23:25 GMT+01:00, Tomas Härdin <tjoppen@acc.umu.se>:
> sön 2018-11-18 klockan 04:40 +0100 skrev Carl Eugen Hoyos:
>> Hi!
>>
>> On systems with signed char, the compiler cannot distinguish between
>> (intended) int8_t used as subscript and unintended char, therefore the
>> warning doesn't help.
>
> Is this done anywhere in the codebase currently?

> Either way, probably a good idea

Patch applied, Carl Eugen
diff mbox

Patch

From dbe60ba171e5ab207b8abda44a9d3236f3079c01 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Date: Sun, 18 Nov 2018 04:32:07 +0100
Subject: [PATCH] configure: Add -Wno-char-subscripts.

Silences many warnings on systems with signed char where
the compiler cannot distinguish between char and int8_t.
---
 configure |    1 +
 1 file changed, 1 insertion(+)

diff --git a/configure b/configure
index 9bc4cf3..ac06f11 100755
--- a/configure
+++ b/configure
@@ -6506,6 +6506,7 @@  check_disable_warning -Wno-format-zero-length
 check_disable_warning -Wno-pointer-sign
 check_disable_warning -Wno-unused-const-variable
 check_disable_warning -Wno-bool-operation
+check_disable_warning -Wno-char-subscripts
 
 check_disable_warning_headers(){
     warning_flag=-W${1#-Wno-}
-- 
1.7.10.4