Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Undefined behaviour warnings with zsh.git and clang



Hi,

With git master I started to see:

clang -c -I. -I../Src -I../Src -I../Src/Zle -I.  -DHAVE_CONFIG_H -O2 -fPIE -
fstack-protector -I/usr/include/ncurses6/ncursesw -I/usr/include/ncurses6  -
o params.o params.c
params.c:1721:18: warning: shifting a negative signed value is undefined [-
Wshift-negative-value]
            v->isarr |= SCANPM_ISVAR_AT;
                        ^~~~~~~~~~~~~~~
./zsh.h:1755:32: note: expanded from macro 'SCANPM_ISVAR_AT'
#define SCANPM_ISVAR_AT   ((-1)<<15)    /* "$foo[@]"-style substitution
                           ~~~~^
params.c:1933:36: warning: shifting a negative signed value is undefined [-
Wshift-negative-value]
            v->isarr = flags | (isvarat ? SCANPM_ISVAR_AT : 0);
                                          ^~~~~~~~~~~~~~~
./zsh.h:1755:32: note: expanded from macro 'SCANPM_ISVAR_AT'
#define SCANPM_ISVAR_AT   ((-1)<<15)    /* "$foo[@]"-style substitution
                           ~~~~^
2 warnings generated.

make test is fine but the warning might be worth looking into.




Messages sorted by: Reverse Date, Date, Thread, Author