Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: empty parentheses were disambiguated as a function declaration #170

Open
geissonator opened this issue May 14, 2021 · 0 comments
Open

Comments

@geissonator
Copy link
Contributor

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();
|       |                                      ^~
|       |                                      --

geissonator added a commit that referenced this issue May 18, 2021
This code as-is is not doing anything other then declaring a function.
The solution is to utilize {} to tell the compiler it's an object
instantiation. Given that this code has been a noop up until this point,
it's best to just comment it out until someone can come in enable and
test it properly.

The latest yocto update which brings in a newer compiler is erroring out
on this so we need something quick to be able to make progress there.

#170 is tracking this issue.

Signed-off-by: Andrew Geissler <[email protected]>
Change-Id: Idd4acd8e8541195f1b6e73c854866281832f1878
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant