foo.cc: In function ‘int main()’:
foo.cc:27:28: warning: unused variable ‘maxn’ [-Wunused-variable]
27 | double l=0,r=0,ans,maxn=0;
| ^~~~
In file included from /nix/gcc-14.2.1.20250322/include/c++/14.2.1.20250322/istream:41,
from /nix/gcc-14.2.1.20250322/include/c++/14.2.1.20250322/sstream:40,
from /nix/gcc-14.2.1.20250322/include/c++/14.2.1.20250322/complex:45,
from /nix/gcc-14.2.1.20250322/include/c++/14.2.1.20250322/ccomplex:39,
from stdc++.h:127:
In member function ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>]’,
inlined from ‘int main()’ at foo.cc:44:32:
/nix/gcc-14.2.1.20250322/include/c++/14.2.1.20250322/ostream:232:25: warning: ‘ans’ may be used uninitialized [-Wmaybe-uninitialized]
232 | { return _M_insert(__f); }
| ~~~~~~~~~^~~~~
foo.cc: In function ‘int main()’:
foo.cc:27:24: note: ‘ans’ was declared here
27 | double l=0,r=0,ans,maxn=0;
| ^~~