[dvblast-devel] dvblastctl: Prevent warning wth gcc 4.7 (no functional changes).

Georgi Chorbadzhiyski git at videolan.org
Fri Apr 6 01:16:52 CEST 2012


dvblast | branch: master | Georgi Chorbadzhiyski <gf at unixsol.org> | Fri Apr  6 02:12:27 2012 +0300| [28b9fb0e45ce53c7c3c1c6accf53003bc07878df] | committer: Georgi Chorbadzhiyski

dvblastctl: Prevent warning wth gcc 4.7 (no functional changes).

The warning was:
dvblastctl.c: In function 'main':
dvblastctl.c:451:13: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

> http://git.videolan.org/gitweb.cgi/dvblast.git/?a=commit;h=28b9fb0e45ce53c7c3c1c6accf53003bc07878df
---

 dvblastctl.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/dvblastctl.c b/dvblastctl.c
index 2397a38..7862b90 100644
--- a/dvblastctl.c
+++ b/dvblastctl.c
@@ -448,7 +448,8 @@ int main( int i_argc, char **ppsz_argv )
         if ( i_size == -1 )
             break;
         if ( !i_packet_size ) {
-            i_packet_size = *((uint32_t *)&p_buffer[4]);
+            uint32_t *p_packet_size = (uint32_t *)&p_buffer[4];
+            i_packet_size = *p_packet_size;
             if ( i_packet_size > COMM_BUFFER_SIZE ) {
                 i_size = -1;
                 break;



More information about the dvblast-devel mailing list