From: Jun T <tak...@kb...> - 2018-07-06 05:53:31
|
I get several warnings while building on macOS by using clang, and I've found some of them are not just warnings but bugs: datafile.c:2145:44: warning: using floating point absolute value function 'fabs' when argument is of integer type [-Wabsolute-value] if (undefined || (a.type == CMPLX && fabs(imag(&a) > zero))) { ^ # should be fabs(imag(&a)) > zero plot2d.c:652:44: warning: implicit conversion from enumeration type 'enum DATA_TYPES' to different enumeration type 'enum coord_type' [-Wenum-conversion] current_plot->points[i].type = (j == 0) ? NOTDEFINED : INRANGE; ~ ^~~~~~~~~~ # 'enum coord_type' has UNDEFINED, not NOTDEFINED ../term/caca.trm:1696:12: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand] if ((head && BOTH_HEADS) != 0) { ^ ~~~~~~~~~~ # should be a single & I believe these three are bugs. The following two are not bugs but better to be "fixed": mouse.c:514:13: warning: format string is not a string literal (potentially insecure) [-Wformat-security] sprintf(s, readout.v.string_val); ^~~~~~~~~~~~~~~~~~~~ ../term/pstricks.trm:1079:49: warning: the value of the size argument in 'strncat' is too large, might lead to a buffer overflow [-Wstrncat-size] strncat(patfill, ",fillcolor=PST@BGCOLOR", sizeof(patfill)); ^~~~~~~~~~~~~~~ The next one is not a problem but the waring can be easily silenced: plot3d.c:1041:40: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] } else if ((this_plot->plot_style == CIRCLES)) { ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~ Jun |