Closed
Bug 716278
Opened 13 years ago
Closed 12 years ago
"warning: invoking macro NS_ENSURE_TRUE argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98" compiler warnings in some Mailnews files
Categories
(MailNews Core :: Backend, defect)
MailNews Core
Backend
Tracking
(Not tracked)
RESOLVED
FIXED
Thunderbird 18.0
People
(Reporter: aceman, Assigned: aceman)
References
(Blocks 1 open bug, )
Details
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
neil
:
review+
|
Details | Diff | Splinter Review |
Similar GCC warnings are output for several files in mailnews:
mailnews/base/src/nsMsgMailSession.cpp:625:32: warning: invoking macro NS_ENSURE_TRUE argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/base/src/nsMsgMailSession.cpp:626:52: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/base/src/nsMsgMailSession.cpp:626:52: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/base/src/nsMsgContentPolicy.cpp:548:25: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/base/src/nsMsgContentPolicy.cpp:548:25: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/base/src/nsMsgContentPolicy.cpp:552:25: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/base/src/nsMsgContentPolicy.cpp:552:25: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/base/src/nsMsgContentPolicy.cpp:555:25: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO
mailnews/base/src/nsMsgContentPolicy.cpp:555:25: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/base/src/nsMsgContentPolicy.cpp:596:25: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/base/src/nsMsgContentPolicy.cpp:596:25: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/base/src/nsMsgContentPolicy.cpp:600:25: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/base/src/nsMsgContentPolicy.cpp:600:25: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/base/src/nsMsgContentPolicy.cpp:613:27: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/base/src/nsMsgContentPolicy.cpp:613:27: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/extensions/bayesian-spam-filter/src/nsBayesianFilter.cpp:333:25: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/extensions/bayesian-spam-filter/src/nsBayesianFilter.cpp:333:25: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/addrbook/src/nsAbAddressCollector.cpp:382:25: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/addrbook/src/nsAbAddressCollector.cpp:382:25: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/addrbook/src/nsAbAddressCollector.cpp:385:25: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/addrbook/src/nsAbAddressCollector.cpp:385:25: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/addrbook/src/nsAbAddressCollector.cpp:389:25: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/addrbook/src/nsAbAddressCollector.cpp:389:25: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/imap/src/nsImapMailFolder.cpp:4257:28: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/imap/src/nsImapMailFolder.cpp:4257:28: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/imap/src/nsImapMailFolder.cpp:4263:30: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/imap/src/nsImapMailFolder.cpp:4263:30: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/imap/src/nsImapMailFolder.cpp:7388:25: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/imap/src/nsImapMailFolder.cpp:7388:25: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/imap/src/nsImapMailFolder.cpp:7447:29: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/imap/src/nsImapMailFolder.cpp:7447:29: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/imap/src/nsAutoSyncManager.cpp:361:34: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/imap/src/nsAutoSyncManager.cpp:361:34: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/local/src/nsLocalMailFolder.cpp:2166:25: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/local/src/nsLocalMailFolder.cpp:2166:25: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/local/src/nsLocalMailFolder.cpp:2190:25: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
mailnews/local/src/nsLocalMailFolder.cpp:2190:25: warning: invoking macro NS_ENSURE_SUCCESS argument 2: empty macro arguments are undefined in ISO C90 and ISO C++98
They are caused by constructs like 'NS_ENSURE_SUCCESS(rv, );' (second argument is empty) inside of void functions. Can this be resolved in some way?
I think NS_ENSURE_SUCCESS(rv, /**/); is enough to shut the compiler up.
That didn't work. Gcc is probably smart enough to remove comments before expanding the macro. But ' (void)0 ' worked for me.
Attachment #590459 -
Flags: feedback?(mbanner)
Comment 7•13 years ago
|
||
Comment on attachment 590459 [details] [diff] [review]
fix for all warnings except in 2 constructors.
Seems reasonable to me, but I'd like to see what Neil thinks as well.
Attachment #590459 -
Flags: feedback?(mbanner) → feedback?(neil)
Comment 8•13 years ago
|
||
Comment on attachment 590459 [details] [diff] [review]
fix for all warnings except in 2 constructors.
Sorry, but my personal preference is not to do this.
Attachment #590459 -
Flags: feedback?(neil)
Comment 9•13 years ago
|
||
Hmm... I'd accept semicolons, if they work...
Comment 10•13 years ago
|
||
(In reply to neil@parkwaycc.co.uk from comment #9)
> Hmm... I'd accept semicolons, if they work...
That would expand to "return ;;", which might cause a "not reached" warning or whatever.
The "only" purpose of NS_ENSURE_SUCCESS() is to print a runtime warning.
Then 2 clean solutions should be:
*if the warning is not needed, just use "if NS_FAILED() return;" or the like.
*if the warning is wanted, add a "#define NS_ENSURE_SUCCESS(res)" etc.
***
As well fix mozilla-central too:
http://mxr.mozilla.org/comm-central/search?string=NS_ENSURE_SUCCESS(rv%2C+)%3B&case=on
Blocks: buildwarning
Assignee | ||
Comment 11•13 years ago
|
||
See bug 609210 comment 11. Bsmedberg does not want the new single argument macros in Core.
So either we define them in mailnews only (but would need to be in some header file included everywhere) or we just expand the few occurrences we have and open-code them as he is proposing.
Neil, Mark, Serge?
Assignee | ||
Comment 12•12 years ago
|
||
According to bug 788242 this causes build failures in some configs so they were forced to accept the single argument macros into Core.
I'll jump on it when it lands!
Assignee | ||
Comment 13•12 years ago
|
||
Neil, would you accept it now that they made the same in m-c?
Attachment #590459 -
Attachment is obsolete: true
Attachment #662296 -
Flags: review?(neil)
Attachment #662296 -
Flags: review?(mbanner)
Comment 14•12 years ago
|
||
Comment on attachment 662296 [details] [diff] [review]
patch v2
Seems reasonable to me.
Attachment #662296 -
Flags: review?(neil) → review+
Comment 15•12 years ago
|
||
Comment on attachment 662296 [details] [diff] [review]
patch v2
Review of attachment 662296 [details] [diff] [review]:
-----------------------------------------------------------------
As Neil's reviewed this, I don't need to.
Attachment #662296 -
Flags: review?(mbanner)
Comment 16•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 18.0
You need to log in
before you can comment on or make changes to this bug.
Description
•