I am using a library that has a path that doesn't set a variable before it is returned, and g++ is giving me a warning about it. Is there a way for me to avoid this warning without changing the library and without disabling the warning?
#include<iostream>
// Begin Library function
inline int foo() {
int y;
if( /*something that will always be true*/ ) y = 42;
return y;
}
// end Library function
void bar(int x) {
std::cout << x;
}
int main() {
int x;
x = foo();
bar(x);
return 0;
}