Closed Bug 853874 Opened 11 years ago Closed 11 years ago

Build with -Wunused-local-typedefs in older GCC versions (since it's part of -Wall in GCC 4.8)

Categories

(Firefox Build System :: General, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

Attachments

(1 file)

We haven't explicitly asked GCC to use "-Wunused-local-typedefs" before, but the forthcoming GCC release (version 4.8) includes it as part of -Wall now, so developers using GCC 4.8 will be building with that warning.

Fortunately, the existing chunks of code that run afoul of the warning in FAIL_ON_WARNINGS code weren't too tricky to address (bug 851237).

I'm filing this bug on adding -Wunused-local-typedefs to the build config, to make us build with it on all GCC versions, so that developers that use GCC (and tinderboxen, which also run old GCC) will catch these errors instead of silently introducing them as time-bombs for bleeding-edge GCC-4.8-using-developers to run into.
Summary: Build with -Wunused-local-typedefs in older GCC versions → Build with -Wunused-local-typedefs in older GCC versions (since it's part of -Wall in GCC 4.8)
Depends on: 851237
Attached patch fix v1Splinter Review
(With bug 855010 fixed, we now don't hit any instances of this warning in FAIL_ON_WARNING directories, so it no longer breaks our build.  Hence, it's safe to add, and it'll prevent devs with older GCC versions from breaking the build for devs with newer GCC versions.)
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #729859 - Flags: review?(mh+mozilla)
(This layers on top of bug 855109's fix, patch-context-wise; hence, adding dependency.)
Depends on: 855109
Attachment #729859 - Flags: review?(mh+mozilla) → review+
Blocks: 855211
I was about to land this, but then I noticed (in a local build with GCC 4.7 & this patch applied) some very spammy instances of this build warning that I thought bug 851237 patch 1 should've addressed, but it apparently didn't address them for GCC 4.7.

I filed bug 855211 to investigate. We may not end up being able to land this after all, unless we can find a workable solution there.
As documented in bug 855211, it appears that our __attribute__((unused)) annotations are ignored on typedefs in GCC 4.7, so there's no straightforward way to silence instances of this warning for typedefs-that-are-really-static-asserts.

Without that, this warning is significantly less attractive, and I don't think we should bother with it.  We'll build with it in GCC 4.8+ (since it's included with -Wall), and __attribute__((unused)) works correctly there, but we don't need to bother with it in GCC 4.7 (unless someone happens to find another simple way to silence the static-assert-generated instances of this warning).

So: I'm going to call this WONTFIX (moderated by the "unless" above).
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: