cole-trapnell-lab / cufflinks

Boost Software License 1.0
310 stars 116 forks source link

warnings about parentheses, etc (clang-8) #115

Open yurivict opened 5 years ago

yurivict commented 5 years ago
locfit/makecmd.c:88:36: warning: '&&' within '||' [-Wlogical-op-parentheses]
    } while ((instr) || (*z !=' ') && (!isterminator(*z)));
                     ~~ ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
locfit/makecmd.c:88:36: note: place parentheses around the '&&' expression to silence this warning
    } while ((instr) || (*z !=' ') && (!isterminator(*z)));
                                   ^
                        (                                )
locfit/startlf.c:425:14: warning: comparison of array 'lf.mi' not equal to a null pointer is always true [-Wtautological-pointer-compare]
    { if (lf.mi!=NULL) lf.mi[MEV] = ENULL;
          ~~~^~  ~~~~

locfit/startlf.c:240:10: warning: comparison of array 'lf.mi' equal to a null pointer is always false [-Wtautological-pointer-compare]
{ if (lf.mi==NULL) return(1);
      ~~~^~  ~~~~
locfit/makecmd.c:203:29: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
  sprintf((char *)vdptr(vs),cmdline);
                            ^~~~~~~
locfit/makecmd.c:203:29: note: treat the string as an argument to avoid this
  sprintf((char *)vdptr(vs),cmdline);
                            ^
                            "%s", 
locfit/c_plot.c:470:14: warning: incompatible pointer types passing 'char *' to parameter of type 'vari *' [-Wincompatible-pointer-types]
  setvarname(curstr,tname);
             ^~~~~~
locfit/vari.hpp:23:27: note: passing argument to parameter 'v' here
    void setvarname(vari* v, varname name);
                          ^
In file included from sampling.cpp:9:
./sampling.h:50:13: warning: unused typedef 'matrix_type' [-Wunused-local-typedef]
                typedef M matrix_type;
                          ^
./sampling.h:113:19: warning: unused typedef 'const_matrix_type' [-Wunused-local-typedef]
                typedef const M const_matrix_type; 
                                ^
./sampling.h:114:42: warning: unused typedef 'vector_type' [-Wunused-local-typedef]
                typedef vector<typename E::value_type> vector_type; 
                                                       ^
./sampling.h:120:19: warning: unused typedef 'const_matrix_type' [-Wunused-local-typedef]
                typedef const M const_matrix_type; 
                                ^
./sampling.h:121:42: warning: unused typedef 'matrix_type' 1 warning generated.
[-Wunused-local-typedef]
                typedef matrix<typename E::value_type> matrix_type; 
                                                       ^

Please compile with clang and fix these and other warnings. Many of them indicate real problems in the code.