HomeFreeBSD

Fix a -Wdangling-else issue with g++

Description

Fix a -Wdangling-else issue with g++

g++ fails to compile capability-fd.cc with the following issues, ad nauseum:

contrib/capsicum-test/capability-fd.cc: In function 'void TryDirOps(int, cap_rights_t)':
contrib/capsicum-test/capability-fd.cc:716:6: error: suggest explicit braces to avoid ambiguous 'else' [-Werror=dangling-else]
   if (rc >= 0) EXPECT_OK(close(rc));

Wrap the EXPECT_OK(..) macro with do-while so it's properly treated like a
code block, as EXPECT_LT(..) expands to a much larger block of code.

Details

Provenance
ngieAuthored on
Parents
rS345422: fusefs: support VOP_MKNOD
Branches
Unknown
Tags
Unknown