bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Patch] Add dirent.d_type support to Cygwin 1.7 ?


From: Jim Meyering
Subject: Re: [Patch] Add dirent.d_type support to Cygwin 1.7 ?
Date: Sat, 29 Nov 2008 16:05:10 +0100

"James Youngman" <address@hidden> 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

[Prev in Thread] Current Thread [Next in Thread]