On Thu, 26 Oct 2006 12:41:50 +0200, Balazs Scheidler said:
affile.c: In function 'affile_dd_init': affile.c:456: warning: comparison is always false due to limited range of data type affile.c:462: warning: comparison is always false due to limited range of data type
This might be a problem if the compiler optimizes the if statement out. I have added casts to fix this issue.
You need to be careful here... sometimes this sort of thing is a "fix" rather than a real fix...
- if (self->file_perm == -1) + if (self->file_perm == (mode_t) -1) self->file_perm = cfg->file_perm;
The reason the compiler complains is that if proper type safety has been followed *elsewhere*, it can't have been equal to -1. In other words, if this is the only place you had to add the cast, it's *still* buggy.