Diff Detail
Diff Detail
Event Timeline
Comment Actions
Fixed the following warnings:
1. gold-plugin.cpp:452:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] case DS_Warning: ^ gold-plugin.cpp:452:3: note: insert 'LLVM_FALLTHROUGH;' to silence this warning 2. gold-plugin.cpp:449:8: warning: variable 'Level' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized] case DS_Error: ^~~~~~~~ gold-plugin.cpp:461:11: note: uninitialized use occurs here message(Level, "LLVM gold plugin: %s", ErrStorage.c_str()); ^~~~~ gold-plugin.cpp:447:3: note: variable 'Level' is declared here ld_plugin_level Level;
tools/gold/gold-plugin.cpp | ||
---|---|---|
450 | Thanks for the fix. I am not sure in fact why we need this separate call to message, rather than just allowing the code to fall through and use the one below the switch statement. I don't see value in the different style of message, particularly now with ThinLTO (looks like this code is quite old, predating ThinLTO). Can you just remove the call to message() here and instead set Level = LDPL_FATAL here? |
Thanks for the fix. I am not sure in fact why we need this separate call to message, rather than just allowing the code to fall through and use the one below the switch statement. I don't see value in the different style of message, particularly now with ThinLTO (looks like this code is quite old, predating ThinLTO).
Can you just remove the call to message() here and instead set Level = LDPL_FATAL here?