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 <niels.reedijk@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
This commit is contained in:
Niels Sascha Reedijk 2023-06-24 21:37:53 +01:00
parent 26bda37ca5
commit fef51dedd8

View File

@ -408,10 +408,20 @@ IMAPFolder::RegisterPendingBodies(IMAP::MessageUIDList& uids,
IMAP::MessageUIDList::const_iterator iterator = uids.begin();
for (; iterator != uids.end(); iterator++) {
if (replyTo != NULL)
if (replyTo != NULL) {
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();
#if __GNUC__ == 13
# pragma GCC diagnostic pop
#endif
}
}
}