FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 01-25-2011, 08:07 PM
Chris Lumens
 
Default GCC seriously needs to be less picky.

Don't tell me I have to catch the return value of write in a variable just
to later complain that I'm not doing anything with that variable. That's
borderline sociopathic behavior.
---
configure.ac | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index 6e677b5..ab37f4a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -185,8 +185,12 @@ if test x$ipv6 = xyes ; then
AC_SUBST(IPV6_CFLAGS, [-DENABLE_IPV6])
fi

+# GCC likes to bomb out on some ridiculous warnings. Add your favorites
+# here.
+SHUT_UP_GCC="-Wno-unused-but-set-variable"
+
# Add remaining compiler flags we want to use
-CFLAGS="$CFLAGS -Wall -Werror -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
+CFLAGS="$CFLAGS -Wall -Werror $SHUT_UP_GCC -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"

# Filter CFLAGS (remove duplicate flags)
cflags_filter() {
--
1.7.1.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 01-25-2011, 08:26 PM
"Brian C. Lane"
 
Default GCC seriously needs to be less picky.

On Tue, Jan 25, 2011 at 04:07:33PM -0500, Chris Lumens wrote:
> Don't tell me I have to catch the return value of write in a variable just
> to later complain that I'm not doing anything with that variable. That's
> borderline sociopathic behavior.
> ---
> configure.ac | 6 +++++-
> 1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 6e677b5..ab37f4a 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -185,8 +185,12 @@ if test x$ipv6 = xyes ; then
> AC_SUBST(IPV6_CFLAGS, [-DENABLE_IPV6])
> fi
>
> +# GCC likes to bomb out on some ridiculous warnings. Add your favorites
> +# here.
> +SHUT_UP_GCC="-Wno-unused-but-set-variable"
> +
> # Add remaining compiler flags we want to use
> -CFLAGS="$CFLAGS -Wall -Werror -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
> +CFLAGS="$CFLAGS -Wall -Werror $SHUT_UP_GCC -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
>
> # Filter CFLAGS (remove duplicate flags)
> cflags_filter() {
> --
> 1.7.1.1

1000 acks.

--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 01-28-2011, 10:22 AM
Hans de Goede
 
Default GCC seriously needs to be less picky.

Hi,

On 01/25/2011 10:07 PM, Chris Lumens wrote:

Don't tell me I have to catch the return value of write in a variable just
to later complain that I'm not doing anything with that variable. That's
borderline sociopathic behavior.


Erm, although I'm no longer part of the team I cannot help but respond here.
The warnings given by gcc-4.6 for unused-but-set-variable are very valid
and very useful. We hit a few in spice to and fixed them rather then just
disabling the warning, removing quite a bit of dead code.

As for your write case, the solution there of course is to do proper
error checking, ie as a minimum do:

if (write(...) == -1)
perror("write");

This way in the unlikely event that a write would fail despite you
expecting it never to fail, you at least have some chance of seeing
an error message pointing to the issue.

Regards,

Hans



---
configure.ac | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index 6e677b5..ab37f4a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -185,8 +185,12 @@ if test x$ipv6 = xyes ; then
AC_SUBST(IPV6_CFLAGS, [-DENABLE_IPV6])
fi

+# GCC likes to bomb out on some ridiculous warnings. Add your favorites
+# here.
+SHUT_UP_GCC="-Wno-unused-but-set-variable"
+
# Add remaining compiler flags we want to use
-CFLAGS="$CFLAGS -Wall -Werror -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
+CFLAGS="$CFLAGS -Wall -Werror $SHUT_UP_GCC -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"

# Filter CFLAGS (remove duplicate flags)
cflags_filter() {


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 06:28 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org