paul-j-lucas / cdecl

Composing and deciphering C (or C++) declarations or casts, aka ‘‘gibberish.’’
GNU General Public License v3.0
90 stars 11 forks source link

Warnings with clang version 12.0.1/FreeBSD 14-CURRENT #16

Closed lrosenman closed 3 years ago

lrosenman commented 3 years ago

with the 11.4 version.

--- getopt.o ---
getopt.c:208:21: warning: implicit conversion changes signedness: 'long' to 'size_t' (aka 'unsigned long') [-Wsign-conversion]
  namelen = nameend - d->__nextchar;
          ~ ~~~~~~~~^~~~~~~~~~~~~~~
getopt.c:255:34: warning: implicit conversion changes signedness: 'int' to 'unsigned long' [-Wsign-conversion]
                        else if ((ambig_set = malloc (n_options)) == NULL)
                                              ~~~~~~  ^~~~~~~~~
getopt.c:263:30: warning: implicit conversion changes signedness: 'int' to 'unsigned long' [-Wsign-conversion]
                            memset (ambig_set, 0, n_options);
                            ~~~~~~                ^~~~~~~~~
getopt.c:369:16: warning: variable 'option_index' may be uninitialized when used here [-Wconditional-uninitialized]
    *longind = option_index;
               ^~~~~~~~~~~~
getopt.c:204:19: note: initialize the variable 'option_index' to silence this warning
  int option_index;
                  ^
                   = 0
4 warnings generated.
--- strnlen1.o ---
strnlen1.c:32:25: warning: implicit conversion changes signedness: 'long' to 'size_t' (aka 'unsigned long') [-Wsign-conversion]
    return end - string + 1;
    ~~~~~~ ~~~~~~~~~~~~~^~~
1 warning generated.

JFYI.

paul-j-lucas commented 3 years ago

This isn't my code. It's part of Gnulib.