Closed Bug 754988 Opened 13 years ago Closed 12 years ago

[10.8] Build fails with "error: expected expression" to NSParameterAssert when building Growl

Categories

(Toolkit :: General, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: zpao, Unassigned)

References

(Blocks 1 open bug)

Details

Clang is actually spitting out an unformatted message but it looks like it's not liking the usage of NSParameterAssert. /Users/pao/Mozilla/mozilla-central-dev/toolkit/components/alerts/mac/growl/GrowlApplicationBridge.m:228:6: error: expected expression do {#pragma clang diagnostic push#pragma clang diagnostic ignored "-Wformat-extra-args" if (!((notifName))) { [[NSAssertionHandler currentHandler] handleFailureInMethod:_cmd object:self file:[NSString stringWithUTF8String:"/Users/pao/Mozilla/mozilla-central-dev/toolkit/components/alerts/mac/growl/GrowlApplicationBridge.m"] lineNumber:228 description:(@"Invalid parameter not satisfying: %s"), "notifName"]; }#pragma clang diagnostic pop } while(0); and another error for the following line as well, which also use NSParameterAssert. As far as I can tell, this should be fine. The usage looks correct (and has been like this for a long time). So it may be a clang issue (blocking bug 574346 for now) If I actually expand NSParameterAssert to what clang spits out, then it works just fine...
Further research shows that this is the result of ccache (even with a cleared cache). If I build the file in question without the ccache command first, then it works just fine. ccache: version 3.1.6 clang: version 4.0 (tags/Apple/clang-418.0.59) (based on LLVM 3.1svn)
(In reply to Paul O'Shannessy [:zpao] from comment #1) > Further research shows that this is the result of ccache (even with a > cleared cache). If I build the file in question without the ccache command > first, then it works just fine. This is a warning being turned into an error with -Werror? It might be that clang is suppressing a warning in a macro expansion but with ccache it doesn't see the macro on the second run. What happens when you run the command with an extra -save-temps?
I was advised to export CCACHE_CPP2=yes. Though when I do this in my mozconfig, it doesn't seem to work. But if I export it in my shell before building, then it does work. (the link I was given: http://petereisentraut.blogspot.com/2011/09/ccache-and-clang-part-2.html)
That is really interesting, thanks. There might still be a clang bug in here, bug using CCACHE_CPP2 with clang is probably the right thing to do.
(In reply to Rafael Ávila de Espíndola (:espindola) from comment #4) > That is really interesting, thanks. > > There might still be a clang bug in here, bug using CCACHE_CPP2 with clang > is probably the right thing to do. Filed bug 755145 (in case this turns out to be a separate issue).
Was this fixed when 755145 got fixed?
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.