On 10/17/16 at 10:17pm, Allan McRae wrote: > On 13/10/16 06:13, ivy.fos...@gmail.com wrote: > > From: Ivy Foster <ivy.fos...@gmail.com> > > > > These functions can return -1 on error, which is not included in the > > enumerated types they were declared to return. > > > > Signed-off-by: Ivy Foster <ivy.fos...@gmail.com> > > --- > > > be_local.c: In function ‘alpm_pkg_set_reason’: > be_local.c:1124:30: error: comparison between signed and unsigned > integer expressions [-Werror=sign-compare] > if(alpm_pkg_get_reason(pkg) == reason) { > ^~ > > You can use --enable-warningflags to build with many of our current > warning flags enabled. > > Why change the return to an int and not add an UNKNOWN value to the enum > (with value 0 or 1 << 30)? > > Allan
The only way get_reason and get_origin return -1 is if pkg is NULL, so UNKNOWN isn't really accurate. We could add an ERROR value, but I was hoping to avoid that. apg