[MPlayer-dev-eng] [PATCH] -fno-strict-aliasing on gcc > 3

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Mon Jul 11 20:41:10 CEST 2005


Hi,
due to problems with mp3lib and a recent IMHO ugly patch to ebml.c
lately, I came to the conclusion that the strict aliasing rules are evil
(or at least a PITA).
So I suggest the attached patch, that adds -fno-strict-aliasing to the
CFLAGS for any gcc >= 3.
Please comment, and fast, since otherwise I will apply Wednesday.

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: configure
===================================================================
RCS file: /cvsroot/mplayer/main/configure,v
retrieving revision 1.1028
diff -u -r1.1028 configure
--- configure	10 Jul 2005 17:14:10 -0000	1.1028
+++ configure	11 Jul 2005 18:36:52 -0000
@@ -6670,10 +6670,14 @@
   CFLAGS="-W -Wall -O2 $_march $_mcpu $_debug $_profile"
   if test "$_cc_major" -ge "3" ; then
     CFLAGS=`echo "$CFLAGS" | sed -e 's/\(-Wall\)/\1 -Wno-unused-parameter/'`
+    CFLAGS="-fno-strict-aliasing $CFLAGS"
   fi
   _stripbinaries=no
 elif test -z "$CFLAGS" ; then
     CFLAGS="-O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
+  if test "$_cc_major" -ge "3" ; then
+    CFLAGS="$CFLAGS -fno-strict-aliasing"
+  fi
   # always compile with '-g' if .developer:
   if test -f ".developer" ; then
     CFLAGS="-g $CFLAGS"


More information about the MPlayer-dev-eng mailing list