Building the latest pretest of wget2 on MinGW produces the following
warning:
CC glob.lo
glob.c: In function 'glob_in_dir':
glob.c:1331:32: warning: case label value exceeds maximum value for type
case DT_DIR: case DT_LNK: case DT_UNKNOWN: break;
^~~~
This is because glob.c unconditionally defines dirent_type data
type as follows:
typedef uint_fast8_t dirent_type;
But if system header dirent.h is found to define the d_type member of
struct dirent, the type should be the same as for d_type, or at least
as wide as that of d_type, otherwise the DT_* constants, which come
from dirent.h, might be outside the valid range of values for unsigned
char. The above typedef should be used only for systems where d_type
member is missing from struct dirent, and the DT_* constants are
defined by Gnulib.
My solution was to use 'typeof' to declare dirent_type such that its
type is the same as that of d_type from struct dirent. An alternative
is to use 'unsigned long' as the type of dirent_type, although I think
that is a bit more risky.
P.S. Please CC me on any responses.