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

Compilation fails in Ubuntu 21.10 presumably due to clang version behavior change #22951

Closed
JMPZ11 opened this issue Nov 17, 2021 · 1 comment · Fixed by #22952
Closed

Compilation fails in Ubuntu 21.10 presumably due to clang version behavior change #22951

JMPZ11 opened this issue Nov 17, 2021 · 1 comment · Fixed by #22952
Labels
PC Issues related to running openpilot on PC

Comments

@JMPZ11
Copy link
Contributor

JMPZ11 commented Nov 17, 2021

Describe the bug

When attempting to compile using "scons -j$(nproc)" in Ubuntu 21.10 the warning "error: variable '...' set but not used [-Werror,-Wunused-but-set-variable]" is encountered in many places throughout the code (the first few are in cereal).

Workarounds are described here: https://gcc.gnu.org/gcc-4.6/porting_to.html

I am not familiar enough with the code to "fix" the underlying issue.
Applying the annotation __attribute__((__unused__)) to the instances does resolve the error, but requires changes across multiple repos (may be unavoidable...)

A "quick" workaround is to add the following to the root SConstruct file around line 192 (CCFLAGS list)

"-Wno-error=unused-but-set-variable",

This however leads to more errors - still diagnosing...

OS Version

Ubuntu 21.10

openpilot version or commit

f1c77f9

Additional info

No response

@JMPZ11 JMPZ11 added the PC Issues related to running openpilot on PC label Nov 17, 2021
@JMPZ11 JMPZ11 changed the title Compilation fails in Ubuntu 21.10 due to clang++ version behavior change (unused-but-set-variable) Compilation fails in Ubuntu 21.10 presumably due to clang version behavior change Nov 17, 2021
@JMPZ11
Copy link
Contributor Author

JMPZ11 commented Nov 17, 2021

@pd0wm The commit was reverted - could you reopen the issue?

@adeebshihadeh Guessing #22952 had unintended consequences - would making the changes conditional help? Different approach? Let me know if I can help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PC Issues related to running openpilot on PC
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant