Closed
Bug 717713
Opened 12 years ago
Closed 12 years ago
Add -Qunused-arguments to Clang compiler flags
Categories
(Firefox Build System :: General, defect)
Firefox Build System
General
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla12
People
(Reporter: gps, Assigned: gps)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-complete, Whiteboard: [inbound])
Attachments
(1 file, 1 obsolete file)
2.51 KB,
patch
|
ted
:
review+
|
Details | Diff | Splinter Review |
I currently have CC and CXX pointing to clang and clang++. m-c builds fine (even with Clang's trunk). However, the Clang driver is pretty verbose by default and reports which CLI arguments went unused during invocation. e.g. clang-3: warning: argument unused during compilation: '-I /Users/gps/src/services-central/browser/components/build/../shell/src' clang-3: warning: argument unused during compilation: '-I /Users/gps/src/services-central/browser/components/build/../feeds/src' clang-3: warning: argument unused during compilation: '-I /Users/gps/src/services-central/browser/components/build/../places/src' clang-3: warning: argument unused during compilation: '-I /Users/gps/src/services-central/browser/components/build/../privatebrowsing/src' clang-3: warning: argument unused during compilation: '-I /Users/gps/src/services-central/browser/components/build/../about' clang-3: warning: argument unused during compilation: '-I /Users/gps/src/services-central/browser/components/build/../dirprovider' clang-3: warning: argument unused during compilation: '-I /Users/gps/src/services-central/browser/components/build/../migration/src' clang-3: warning: argument unused during compilation: '-I /Users/gps/src/services-central/browser/components/build' clang-3: warning: argument unused during compilation: '-I .' clang-3: warning: argument unused during compilation: '-I ../../../dist/include' clang-3: warning: argument unused during compilation: '-I ../../../dist/include/nsprpub' clang-3: warning: argument unused during compilation: '-I /Users/gps/src/services-central/obj-ff-dbg/dist/include/nspr' clang-3: warning: argument unused during compilation: '-I /Users/gps/src/services-central/obj-ff-dbg/dist/include/nss' clang-3: warning: argument unused during compilation: '-include ../../../mozilla-config.h' clang-3: warning: argument unused during compilation: '-std=gnu++0x' clang-3: warning: argument unused during compilation: '-pthread' You see spew like this for nearly every compiler invocation, even with make -s. The easy way to fix this is to add -Qunused-arguments to CFLAGS and CXXFLAGS. I do this locally in my .mozconfig and it works fine. But, I think it would be helpful if it were a built-in default. The only downside is this could silence legit warnings (perhaps you think that argument you just added should be doing something). So, if this is marked WONTFIX or if you'd want this to be an optional feature (perhaps on by default and disabled via configure --show-unused-arguments-warnings or something), I'd understand.
Assignee | ||
Comment 1•12 years ago
|
||
Here's my first stab at it. I got the main and js configure. I still see the warnings for NSPR, but its configure if off-limits, right? Are there any other configure scripts I should hit? Also, I'm not sure if I defined the check in the proper place or if I assigned to the proper variable. But, the change does seem to work :) I should also mention that the reported problem is much worse with ccache enabled. This is because under the hood ccache is invoking ${compiler} -E and it is often this invocation that produces most of the unused argument warnings.
Assignee | ||
Comment 2•12 years ago
|
||
https://developer.mozilla.org/en/ccache can be updated after this lands (remove -Qunused-arguments).
Keywords: dev-doc-needed
Comment 3•12 years ago
|
||
You can fix NSPR's configure, you'll just have to do it in a separate NSPR bug.
Comment 4•12 years ago
|
||
Comment on attachment 588198 [details] [diff] [review] Add -Qunused-arguments to Clang compiler flags, v1 Review of attachment 588198 [details] [diff] [review]: ----------------------------------------------------------------- I really don't think we need an --enable flag for this. Just set the flags unconditionally if building with clang.
Attachment #588198 -
Flags: review?(ted.mielczarek) → review-
Isn't Qunused-arguments also needed for CPPFLAGS? Googling gives me a lot of "CPPFLAGS=-Qunused-arguments". On the other hand I've never seen to add it for CXXFLAGS. -Qunused-arguments seems only usefull for CPPFLAGS and CFLAGS.
Assignee | ||
Comment 6•12 years ago
|
||
Removed configure option. Added argument to CPPFLAGS.
Attachment #588198 -
Attachment is obsolete: true
Attachment #590768 -
Flags: review?(ted.mielczarek)
Updated•12 years ago
|
Attachment #590768 -
Attachment is patch: true
Updated•12 years ago
|
Attachment #590768 -
Flags: review?(ted.mielczarek) → review+
Assignee | ||
Comment 7•12 years ago
|
||
Pushed to inbound: https://hg.mozilla.org/integration/mozilla-inbound/rev/92844ace31ec Updated https://developer.mozilla.org/en/ccache. I'll file a follow-up bug for NSPR.
Keywords: dev-doc-needed → dev-doc-complete
Whiteboard: [inbound]
Assignee | ||
Comment 8•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/92844ace31ec
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla12
Updated•6 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•