On Wed, Mar 01, 2017 at 04:44:01PM +0100, Tomasz CEDRO wrote: > On Wed, Mar 1, 2017 at 3:08 PM, Xiaofan Chen <xiaof...@gmail.com> wrote: > > Making all in global > > CC parse.lo > > CC log-error.lo > > CC data_dir.lo > > CC params.lo > > params.c:246:14: warning: comparison of constant -1 with expression of type > > 'urj_param_type_t' (aka 'enum URJ_PARAM_TYPE_T') is always false > > [-Wtautological-constant-out-of-range-compare] > > if (type == -1) > > ~~~~ ^ ~~ > > 1 warning generated. > > There lots of warnings of this kind generated, caused by out of range > comparisons that always give false logic.. something worth cleaning up > in near future..
The lines that triggered the compiler warning 244 245 type = urj_param_type_of(params, key); 246 if (type == -1) 247 return URJ_STATUS_FAIL; 248 The function called, also in urjtag/src/global/params.c 62 63 static urj_param_type_t 64 urj_param_type_of(const urj_param_list_t *params, int key) 65 { 66 int i; 67 68 for (i = 0; i < params->n; i++) 69 if (params->list[i].key == key) 70 return params->list[i].type; 71 72 urj_error_set (URJ_ERROR_INVALID, "unknown key %d", key); 73 return -1; 74 } 75 Proposals for getting around the compiler warning -Wtautological-constant-out-of-range-compare are very welcome. Groeten Geert Stappers -- Leven en laten leven ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ UrJTAG-development mailing list UrJTAG-development@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/urjtag-development