diff mbox

[FFmpeg-devel,2/2] Fix audiomatch complie warning

Message ID CADxeRw=i_6=aKMcdFgK8BFvo4dpGDLdu2S-z1JU_zaASwFNhLw@mail.gmail.com
State Accepted
Commit 500662784341373d625af629cad94826beca3bc8
Headers show

Commit Message

Steven Liu Aug. 25, 2016, 1:06 p.m. UTC
Making sure bestpos is initialized to zero to prevent gcc from kvetching.
It's harmless (although it's not obvious that it's harmless)
from code inspection:
tests/audiomatch.c: In function ‘main’:
tests/audiomatch.c:40: warning: ‘bestpos’ may be used uninitialized in this
function

Thanks to Moritz Barsnick for first bringing this to the attention.

Signed-off-by: LiuQi <liuqi@gosun.com>
---
 tests/audiomatch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.7.4

Comments

Michael Niedermayer Aug. 25, 2016, 4:41 p.m. UTC | #1
On Thu, Aug 25, 2016 at 09:06:42PM +0800, Steven Liu wrote:
> Making sure bestpos is initialized to zero to prevent gcc from kvetching.
> It's harmless (although it's not obvious that it's harmless)
> from code inspection:
> tests/audiomatch.c: In function ‘main’:
> tests/audiomatch.c:40: warning: ‘bestpos’ may be used uninitialized in this
> function
> 
> Thanks to Moritz Barsnick for first bringing this to the attention.
> 
> Signed-off-by: LiuQi <liuqi@gosun.com>

applied

thx

[...]
diff mbox

Patch

diff --git a/tests/audiomatch.c b/tests/audiomatch.c
index 9752f68..ca56df0 100644
--- a/tests/audiomatch.c
+++ b/tests/audiomatch.c
@@ -37,7 +37,7 @@  int main(int argc, char **argv){
     FILE *f[2];
     int i, pos;
     int siglen, datlen;
-    int bestpos;
+    int bestpos = 0;
     double bestc=0;
     double sigamp= 0;
     int16_t *signal, *data;