`Might not have been initialized' is here wrong
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
I'm using the following piece of code:
==
for (int i = 1; (curr_line = input_file.readLine()) != null; i++) {
if (i == 1) {
line_length_ref = curr_line.length();
}
else {
if (curr_line.length() != line_length_ref) {
System.err.println("Input file must contain same number of columns through rows.");
System.exit(1);
}
} // some other things
k = i;
}
if (k != line_length_ref) {
// do some things
}
==
The compiler tells me that
* line_length_ref might not have been initialized at L. 6 (numbering
from this first line of code). However, if the else {} block is
launched at some time, line_length_ref will have already been
initialized, so I don't see where's the problem on an algorithmic POV,
* k might not have been initialized.
Do you have any workaround?
- --
Merciadri Luca
See http://www.student.montefiore.ulg.ac.be/~merciadri/
- --
Remember. If something can go wrong, it will.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>
iEYEARECAAYFAk2MqtsACgkQM0LLzLt8MhyTWACbBvbEygnJj+oGdHuwD8jVogoz
G+gAnR7Z4yiMZQSjvxtwjQnljV4HfBqG
=MuGy
-----END PGP SIGNATURE-----