문제

When I'm compiling manufacturer's source code for my smartphone kernel, there's a lot of various unused variables/functions warnings. Is there any option to set to GCC/LD to don't compile these unused stuff?

I found solution here How to remove unused C/C++ symbols with GCC and ld? but it conflicts with incremental linking so I can't use it. Any other solution?

도움이 되었습니까?

해결책

GCC's unused variable warning is just that--it's telling you that code declared a variable but didn't use it. It won't actually compile any code for such a variable, because there is no code to compile, just the declaration. It's a warning because it's often a symptom of sloppy programming.

Removing linker symbols is a completely unrelated issue, and generally not something you want to to. Why do you think you want to do this?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top