Roger Binns wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Michael Comperchio wrote:
>
>> in io.h write returns an int - number of bytes written. Declare an int
>> and catch the return value. :)
>>
>
> And then the compiler will complain that the variable assigned the value
> is not used elsewhere. You get to keep playing whack-a-mole.
>
> Roger
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAkmHrB0ACgkQmOOfHg372QQnqQCcCL7HE3aZujFZV/Mn6o+LPYWL
> VdUAnAlbcTWBuZZUCI+G3mEnAybh0gkU
> =jNZ5
> -----END PGP SIGNATURE-----
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>
And, since the code in question is to fix a problem, me thinks that,
perhaps, the developer should be checking to see that, in fact, he got
his single byte written.
int rc;
rc = write(dahdadah);
if (!rc)
{
print_out_i_didn't_write_message("Call the fantastic developer, who
not being quick or dead, remembered to check the return codes from file
i/o functions to make sure that they did what they were supposed);
exit(GO_HOME_EARLY_AND_DRINK_BEER);
}
Today's compilers are some of the best tools available for quality
software development. If we pay attention to those 'whack-a-mole'
issues, and think about them, we are probably, 99% of the time, going to
find that the compiler IS on our side. I remember days when I could hand
code better assembler and machine code than the compilers, but those
days are long gone....
Michael
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users