After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 89622 - [BUILD] -Wall and -Werror break non gcc compilers
[BUILD] -Wall and -Werror break non gcc compilers
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Solaris
: Urgent critical
: 0.5.0
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 99816 (view as bug list)
Depends on:
Blocks: 94122
 
 
Reported: 2002-08-01 14:22 UTC by Shaun Merrigan
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.0



Description Shaun Merrigan 2002-08-01 14:22:23 UTC
I tried to build gstreamer from cvs. the flags -Wall and -Werror are not
supported in forte I had to edit configure.ac

-AS_VERSION(gstreamer, GST_VERSION, 0, 4, 0, 1, GST_ERROR="-Wall",
GST_ERROR="-Wall -Werror")
+AS_VERSION(gstreamer, GST_VERSION, 0, 4, 0, 1, GST_ERROR="", GST_ERROR="")

could you only set these flags if it finds a compilers which supports them?

it is also hard coded in some of the makefiles

Regards
Shaun
Comment 1 Thomas Vander Stichele 2002-08-13 14:14:03 UTC
Never used forte before ;) can you tell me how I go about detecting
this in the configure.ac file ?

thanks
Comment 2 Sander Vesik 2002-08-18 22:16:32 UTC
[i think this should be reopened]

you can check say the $GCC varaible to see whetever the compiler (as
presented in $CC/$CXX) is gcc or no and use gcc specific options only
when the compiler is actually gcc. 
Comment 3 Shaun Merrigan 2002-08-19 09:34:09 UTC
this macro GNOME_COMPILE_WARNINGS in
gnome-common/macros2/compiler-flags.m4
seems to be the thing we need
I have found examples of its use in these packages

hope this helps

./src-2.0n-160802/libbonobo/configure.in
./src-2.0n-160802/gnome-vfs/configure.in
./src-2.0n-160802/libgnomecanvas/configure.in
./src-2.0n-160802/libgnome/configure.in
./src-2.0n-160802/libbonoboui/configure.in
./src-2.0n-160802/libgnomeui/configure.in
./src-2.0n-160802/libgnomeprint/configure.in
./src-2.0n-160802/libgnomeprintui/configure.in
./src-2.0n-160802/gnome-desktop/configure.in
./src-2.0n-160802/gnome-panel/configure.in
./src-2.0n-160802/gnome-session/configure.in
./src-2.0n-160802/at-spi/configure.in
./src-2.0n-160802/gnome-utils/configure.in
./src-2.0n-160802/gnome-control-center/configure.in
./src-2.0n-160802/gnome-applets/configure.in
./src-2.0n-160802/yelp/configure.in
./src-2.0n-160802/eog/configure.in
./src-2.0n-160802/ghex/configure.in
./src-2.0n-160802/gperfmeter/configure.in
./src-2.0n-160802/gprocview/configure.in
./src-2.0n-160802/gok/configure.in
./src-2.0n-160802/gnome-speech/configure.in
./src-2.0n-160802/at-poke/configure.in
./src-2.0n-160802/gnopernicus/configure.in
./src-2.0n-160802/gnome-mag/configure.in
./src-2.0n-160802/galf/configure.in
Comment 4 Thomas Vander Stichele 2002-09-09 20:43:18 UTC
*** Bug 89574 has been marked as a duplicate of this bug. ***
Comment 5 Christian Fredrik Kalager Schaller 2002-09-15 17:11:30 UTC
*** Bug 87823 has been marked as a duplicate of this bug. ***
Comment 6 Christian Fredrik Kalager Schaller 2002-10-10 20:35:11 UTC
Ok, since I am over on RH8 this is starting to bite me too, thomas do
you have any fix for this in the horizon? Or is configure.in editing
the solution atm :)
Comment 7 Thomas Vander Stichele 2002-10-19 14:31:35 UTC
Christian, you're bitten by another bug ;)
AFAIK you still use gcc ;)
Comment 8 Christian Fredrik Kalager Schaller 2002-10-19 23:57:17 UTC
Sander does Forte have something similar to -Wall and -Werror?
Comment 9 Christian Fredrik Kalager Schaller 2002-10-24 12:36:48 UTC
<Uraeus> laca: when my question is simply; is there some equivalents
to  -Wall and -Werror in Forte?
<laca> -Wall: the forte default is to show all warnings
<laca> -Werror: -errwarn=<t> Treats warnings specified by tags
t(%none, %all, <tag list>) as errors
Comment 10 Christian Fredrik Kalager Schaller 2002-11-28 14:31:43 UTC
*** Bug 99816 has been marked as a duplicate of this bug. ***
Comment 11 Brian Cameron 2002-11-28 14:40:43 UTC
I'm copying this information from my other bug, which was marked
as a duplicate of this one.  Following is a technique that glib
uses to only include -Wall and -Werror if gcc is the compiler being
used:


--glib example start--

                  if test "x$GCC" = "xyes"; then
                    case " $CFLAGS " in
                    *[[\ \    ]]-Wall[[\ \    ]]*) ;;
                    *) CFLAGS="$CFLAGS -Wall" ;;
                    esac

                    if test "x$enable_ansi" = "xyes"; then
                      case " $CFLAGS " in
                      *[[\ \  ]]-ansi[[\ \    ]]*) ;;
                      *) CFLAGS="$CFLAGS -ansi" ;;
                      esac

                      case " $CFLAGS " in
                      *[[\ \  ]]-pedantic[[\ \    ]]*) ;;
                      *) CFLAGS="$CFLAGS -pedantic" ;;
                      esac
                    fi
                  fi
Comment 12 Christian Fredrik Kalager Schaller 2002-11-29 09:47:10 UTC
Actually we want to make this fix the opposite, that instead of
checking for gcc we check for Forte and if Forte is used then we don't
use -Wall -Werror
Comment 13 Sander Vesik 2002-11-30 19:18:15 UTC
I'm not sure that is a good solution - it will just mean that whenever 
somebody goes to compile with a compiler that is not gcc they will need 
yet another workaround. Compiler / environment specific flags should
only be set if you know that the result is going to be valid.

Comment 14 Christian Fredrik Kalager Schaller 2002-12-06 10:57:45 UTC
I guess the question here is if -Wall and -Werror can be assumed to
exist in most C compilers or not. If it is just gcc and a few others I
guess checking for gcc is the solution. However if -Wall and -Werror
exist in most C compilers except Forte and a few others I guess
checking for Forte is the right solution.
Comment 15 Christian Fredrik Kalager Schaller 2003-01-16 10:05:34 UTC
*** Bug 103582 has been marked as a duplicate of this bug. ***
Comment 16 Christian Fredrik Kalager Schaller 2003-01-16 10:12:02 UTC
Ok, just marked a bug of my result trying to compile GStreamer with
the Intel Linux compiler and it to barfs due to -Wall. I think we can
assume that making -Wall only used for gcc is the correct solution. 
Comment 17 Thomas Vander Stichele 2003-01-20 15:06:50 UTC
fixed in cvs for forte.  I'll need access to an intel compiler if I
want to do somethign similar there.