mail_daemon: warn about unused return value

GCC 13 warns that using the `begin()` method on a container is marked as
`[[nodiscard]]`. This makes sure that this warning is not treated as an error.

The code actually looks like it does not do much if anything of use. As a
follow-up ticket #18478 is raised.

Change-Id: Ie149f7e02cacda2bcd0be59617583605d5905747
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6655
Reviewed-by: Niels Sascha Reedijk <[email protected]>
Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
Niels Sascha Reedijk
2023-07-23 16:48:21 +00:00
parent 26bda37ca5
commit fef51dedd8
@@ -408,10 +408,20 @@ IMAPFolder::RegisterPendingBodies(IMAP::MessageUIDList& uids,
IMAP::MessageUIDList::const_iterator iterator = uids.begin(); IMAP::MessageUIDList::const_iterator iterator = uids.begin();
for (; iterator != uids.end(); iterator++) { for (; iterator != uids.end(); iterator++) {
if (replyTo != NULL) if (replyTo != NULL) {
fPendingBodies[*iterator].push_back(*replyTo); fPendingBodies[*iterator].push_back(*replyTo);
else } else {
// Note: GCC 13 warns about the unused result of the statement below. This code should
// be reviewed as part of #18478
#if __GNUC__ == 13
# pragma GCC diagnostic push
# pragma GCC diagnostic warning "-Wunused-result"
#endif
fPendingBodies[*iterator].begin(); fPendingBodies[*iterator].begin();
#if __GNUC__ == 13
# pragma GCC diagnostic pop
#endif
}
} }
} }