Closed Bug 529441 Opened 10 years ago Closed 10 years ago

Build with -Werror=return-type

Categories

(Firefox Build System :: General, defect)

x86
Linux
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.9.3a1

People

(Reporter: cjones, Assigned: cjones)

References

Details

Attachments

(1 file)

This would cause the buggy program

int foo() {
}

to produce an error instead of

ret.c: In function ‘foo’:
ret.c:2: warning: control reaches end of non-void function

I've accidentally missed that warning a several times on first compile.  I feel quite confident in stating that there's *no* plausible exception to this being an error.
Unsurprisingly this didn't find any existing bugs.
Assignee: nobody → jones.chris.g
Attachment #412990 - Flags: review?(ted.mielczarek)
Comment on attachment 412990 [details] [diff] [review]
add -Werror=return-type configure.in test

Is this flag not supported by all versions of GCC that we care about? If it's relatively new then this is fine. If it's been around for a long time, then you could just stick it in the unconditional list of _WARNINGS_CXXFLAGS up above.
Attachment #412990 - Flags: review?(ted.mielczarek) → review+
My OS X/gcc setup (10.5/4.0) doesn't support -Werror=*.  I imagine this is a common dev configuration.

I imagine that if we start accumulation -Werror= flags (there's another open bug to add -Werror=hidden-virtual), we'd want a single test for -Werror=* support and then just stick all those in _WARNINGS_CXXFLAGS.
Pushed http://hg.mozilla.org/mozilla-central/rev/a9addb7dc548
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a1
Version: unspecified → Trunk
Flags: in-testsuite-
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.