Skip to contentSkip to conversation

Kill -Wunused-but-set warnings

PATCH In review David Miller 2 participants 3 messages Apr 18, 2011

Subsystems (2)
lore
Share & tools
lore

David Miller

author maintainer
#0 lore raw

cover Kill -Wunused-but-set warnings

The weather is real nice, so I decided to lock myself inside and fix compiler warnings.

I started using gcc-4.6.x on my primary sparc64 build test machine the other week and it now enables -Wunused-but-set with -Wall and it does catch a bunch of bogus stuff.

Most of the cases are where you'd expect them, ISDN and ATM.

This is the first pass I've made over the networking cases.

There's still a bunch more to do.

#1 lore raw
Quoted 6 lines · David Miller

The weather is real nice, so I decided to lock myself inside and fix compiler warnings.

I started using gcc-4.6.x on my primary sparc64 build test machine the other week and it now enables -Wunused-but-set with -Wall and it does catch a bunch of bogus stuff.

[...]

In most of these cases there is presumably no need for the variable at all. In others, the variable should have been used - which I believe is the main reason for the warning - and by removing it you will be hiding a bug.

Ben.

Signature · 3 lines
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
author maintainer
#2 lore raw

From: Ben Hutchings <[email protected]>
Date: Mon, 18 Apr 2011 03:19:15 +0100

Quoted 4 lines

In most of these cases there is presumably no need for the variable at all. In others, the variable should have been used - which I believe is the main reason for the warning - and by removing it you will be hiding a bug.

If you look at about 5 or 6 of my patches, that's exactly what I did, make use of the variable.

Otherwise I tossed it.

It seems I messed up the decnet case, which I'll fix shortly.