"James Youngman" <[EMAIL PROTECTED]> wrote:
>> +static void
>> +set_stat_type (struct stat *st, unsigned int dtype)
>> +{
>> +  mode_t type;
>> +  switch (dtype)
>> +    {
>> +    case DT_BLK:
>> +      type = S_IFBLK;
>> +      break;
>> +    case DT_CHR:
>> +      type = S_IFCHR;
>> +      break;
>> +    case DT_DIR:
>> +      type = S_IFDIR;
>> +      break;
>> +    case DT_FIFO:
>> +      type = S_IFIFO;
>> +      break;
>> +    case DT_LNK:
>> +      type = S_IFLNK;
>> +      break;
>> +    case DT_REG:
>> +      type = S_IFREG;
>> +      break;
>> +    case DT_SOCK:
>> +      type = S_IFSOCK;
>> +      break;
>> +    default:
>> +      type = 0;
>> +    }
>> +  st->st_mode = dtype << s_ifmt_shift_bits ();
>> +}
>
> As far as I can see, the variable type is assigned in the function
> above, but never used.   Did you mean to use "type" rather than
> "dtype" in the expression which assigns to st->st_mode?

Doesn't (didn't) gcc warn about that?
It doesn't for me, now, with gcc-4.3.x.


Reply via email to