error: empty parentheses were disambiguated as a function declaration
geissonator opened this issue · 0 comments
geissonator commented
Moving to a newer gcc has identified an existing bug. We saw the same thing over in phosphor-user-manager in openbmc/phosphor-user-manager#10.
This code as-is is not doing any locking so to make forward progress I'm going to put up a commit to just comment it out (so we can get upstream yocto in) and then someone can use this issue to renable it using {} and verify any needed test cases.
| ../../git/user_channel/passwd_mgr.cpp: In member function 'void ipmi::PasswdMgr::initPasswordMap()':
| ../../git/user_channel/passwd_mgr.cpp:230:38: error: empty parentheses were disambiguated as a function declaration [-Werror=vexing-parse]
| 230 | phosphor::user::shadow::Lock lock();
| | ^~
| ../../git/user_channel/passwd_mgr.cpp:230:38: note: remove parentheses to default-initialize a variable
| 230 | phosphor::user::shadow::Lock lock();
| | ^~
| | --
| ../../git/user_channel/passwd_mgr.cpp:230:38: note: or replace parentheses with braces to value-initialize a variable
| ../../git/user_channel/passwd_mgr.cpp: In member function 'int ipmi::PasswdMgr::updatePasswdSpecialFile(const string&, const string&)':
| ../../git/user_channel/passwd_mgr.cpp:360:38: error: empty parentheses were disambiguated as a function declaration [-Werror=vexing-parse]
| 360 | phosphor::user::shadow::Lock lock();
| | ^~
| ../../git/user_channel/passwd_mgr.cpp:360:38: note: remove parentheses to default-initialize a variable
| 360 | phosphor::user::shadow::Lock lock();
| | ^~
| | --