Re: Re: [Chromium-dev] Chromium 1.9 second release candidate

Michael Barnes <[email protected]> Wed, 24 May 2006 17:19:42 -0400
Newsgroups gmane.comp.graphics.chromium.user,gmane.comp.graphics.chromium.devel
Message-ID <[email protected]>
--fdj2RfSjLxBAspz7
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by compsci.wm.edu id k4OLJgJ03042

All,

I may have a better patch attached.  If -Werror is needed for building
cromium, then it might be better just to shut up gcc's bogus warning
about something that "may be used unitialized".  The flag that shuts
this up is -Wno-uninitialized.

From gcc's manpage:

      These warnings are made optional because GNU CC is not smart
      enough to see all the reasons why the code might be correct
      despite appearing to have an error.

Uninitialized variables are bugs.  Warnings about them maybe being
uninitilized being turned into errors, when they are not unitialized,
is a waste of our time.

Please consider the attached patch.

The patch is against 1.8, but it should apply cleanly to 1.9.

Mike


On Wed, May 24, 2006 at 01:19:29PM -0700, Eric Sandall wrote:
> And again when the above is fixed:
> Rebuilding dependencies for state_program.c
> Compiling state_program.c
> cc1: warnings being treated as errors
> state_program.c: In function =E2=80=98crStateGetVertexAttribdvARB=E2=80=
=99:
> state_program.c:1113: warning: =E2=80=98floatParams[0]=E2=80=99 is used
> uninitialized in this function
> state_program.c:1111: warning: =E2=80=98floatParams[1]=E2=80=99 may be =
used
> uninitialized in this function
> state_program.c:1111: warning: =E2=80=98floatParams[2]=E2=80=99 may be =
used
> uninitialized in this function
> state_program.c:1111: warning: =E2=80=98floatParams[3]=E2=80=99 may be =
used
> uninitialized in this function
> gmake[2]: *** [../built/crstate/Linux/state_program.o] Error 1
> gmake[1]: *** [dep] Error 2
> make: *** [state_tracker.subdir] Error 2
> --- state_tracker/state_program.c	2006-05-24 13:17:36.000000000 -0700
> +++ /tmp/state_program.c	2006-05-24 13:16:42.000000000 -0700
> @@ -1094,7 +1094,8 @@
> =20
>  void STATE_APIENTRY crStateGetVertexAttribivARB(GLuint index, GLenum p=
name, GLint *params)
>  {
> -	 GLfloat floatParams[4];
> +	 /* init vars to prevent compiler warnings/errors */
> +	 GLfloat floatParams[4] =3D { 0.0, 0.0, 0.0, 0.0 };
>  	 crStateGetVertexAttribfvARB(index, pname, floatParams);
>  	 params[0] =3D (GLint) floatParams[0];
>  	 if (pname =3D=3D GL_CURRENT_VERTEX_ATTRIB_ARB) {
> @@ -1107,7 +1108,8 @@
> =20
>  void STATE_APIENTRY crStateGetVertexAttribdvARB(GLuint index, GLenum p=
name, GLdouble *params)
>  {
> -	 GLfloat floatParams[4];
> +	 /* init vars to prevent compiler warnings/errors */
> +	 GLfloat floatParams[4] =3D { 0.0, 0.0, 0.0, 0.0 };
>  	 crStateGetVertexAttribfvARB(index, pname, floatParams);
>  	 params[0] =3D floatParams[0];
>  	 if (pname =3D=3D GL_CURRENT_VERTEX_ATTRIB_ARB) {


--=20
/-----------------------------------------\
| Michael Barnes <[email protected]> |
| UNIX/Linux HPC Systems Administrator    |
| College of William and Mary             |
| Phone: (757) 879-3930 (cell)            |
\-----------------------------------------/

--fdj2RfSjLxBAspz7
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="cr.diff"

Only in cr-1.8.uninitfix/: bin
Only in cr-1.8.uninitfix/: built
diff -u --recursive cr-1.8/config/FreeBSD.mk cr-1.8.uninitfix/config/FreeBSD.mk
--- cr-1.8/config/FreeBSD.mk	Thu Mar 24 11:29:13 2005
+++ cr-1.8.uninitfix/config/FreeBSD.mk	Wed May 24 17:04:17 2006
@@ -7,12 +7,12 @@
 CXX = g++
 CC = gcc
 
-CXXFLAGS          += -DFREEBSD -Wall -Werror -I/usr/X11R6/include \
+CXXFLAGS          += -DFREEBSD -Wall -Werror -Wno-uninitialized -I/usr/X11R6/include \
                      -fno-strict-aliasing -fPIC
 CXX_RELEASE_FLAGS += -O3 -DNDEBUG
 CXX_DEBUG_FLAGS   += -g
 
-CFLAGS            += -DFREEBSD -Wall -Werror -I/usr/X11R6/include \
+CFLAGS            += -DFREEBSD -Wall -Werror -Wno-uninitialized -I/usr/X11R6/include \
                      -fno-strict-aliasing -fPIC
 C_RELEASE_FLAGS   += -O3 -DNDEBUG
 C_DEBUG_FLAGS     += -g
diff -u --recursive cr-1.8/config/Linux.mk cr-1.8.uninitfix/config/Linux.mk
--- cr-1.8/config/Linux.mk	Thu Mar 24 11:29:13 2005
+++ cr-1.8.uninitfix/config/Linux.mk	Wed May 24 17:04:40 2006
@@ -12,11 +12,11 @@
 # P4/Xeon systems:
 #-O3 -DNDEBUG -fno-strict-aliasing -fomit-frame-pointer -fexpensive-optimizations -falign-functions=4 -funroll-loops -malign-double -fprefetch-loop-arrays -march=pentium4 -mcpu=pentium4 -msse2 -mfpmath=sse 
 
-CXXFLAGS          += -DLINUX -Wall -Werror
+CXXFLAGS          += -DLINUX -Wall -Werror -Wno-uninitialized
 CXX_RELEASE_FLAGS += -O3 -DNDEBUG -fno-strict-aliasing
 CXX_DEBUG_FLAGS   += -g
 
-CFLAGS            += -DLINUX -Wall -Werror -Wmissing-prototypes -Wsign-compare
+CFLAGS            += -fPIC -DLINUX -Wall -Werror -Wno-uninitialized -Wmissing-prototypes -Wsign-compare
 C_RELEASE_FLAGS   += -O3 -DNDEBUG -fno-strict-aliasing
 C_DEBUG_FLAGS     += -g
 
diff -u --recursive cr-1.8/config/OSF1.mk cr-1.8.uninitfix/config/OSF1.mk
--- cr-1.8/config/OSF1.mk	Thu Mar 24 11:29:13 2005
+++ cr-1.8.uninitfix/config/OSF1.mk	Wed May 24 17:04:53 2006
@@ -4,11 +4,11 @@
 CXX = cxx
 CC = cc
 
-CXXFLAGS          += -DOSF1 -I/usr/local/include -Wall -Werror -pthread
+CXXFLAGS          += -DOSF1 -I/usr/local/include -Wall -Werror -Wno-uninitialized -pthread
 CXX_RELEASE_FLAGS += -O3 -DNDEBUG
 CXX_DEBUG_FLAGS   += -g
 
-CFLAGS            += -DOSF1 -I/usr/local/include -Wall -Werror -pthread
+CFLAGS            += -DOSF1 -I/usr/local/include -Wall -Werror -Wno-uninitialized -pthread
 C_RELEASE_FLAGS   += -O3 -DNDEBUG
 C_DEBUG_FLAGS     += -g
 
diff -u --recursive cr-1.8/config/SunOS.mk cr-1.8.uninitfix/config/SunOS.mk
--- cr-1.8/config/SunOS.mk	Thu Mar 24 11:29:13 2005
+++ cr-1.8.uninitfix/config/SunOS.mk	Wed May 24 17:05:08 2006
@@ -23,11 +23,11 @@
 #
 OTHER_FLAGS = -DSOLARIS_9_X_BUG
 
-CXXFLAGS          += -DSunOS -DSUN_OGL_NO_VERTEX_MACROS -Wall -Werror -fPIC $(OTHER_INCLUDES) $(OTHER_FLAGS)  
+CXXFLAGS          += -DSunOS -DSUN_OGL_NO_VERTEX_MACROS -Wall -Werror -Wno-uninitialized -fPIC $(OTHER_INCLUDES) $(OTHER_FLAGS)  
 CXX_RELEASE_FLAGS += -O3 -DNDEBUG
 CXX_DEBUG_FLAGS   += -g
 
-CFLAGS            += -DSunOS -DSUN_OGL_NO_VERTEX_MACROS -Wall -Werror -fPIC $(OTHER_INCLUDES) $(OTHER_FLAGS) 
+CFLAGS            += -DSunOS -DSUN_OGL_NO_VERTEX_MACROS -Wall -Werror -Wno-uninitialized -fPIC $(OTHER_INCLUDES) $(OTHER_FLAGS) 
 C_RELEASE_FLAGS   += -O3 -DNDEBUG
 C_DEBUG_FLAGS     += -g

--fdj2RfSjLxBAspz7--


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642