On Tuesday 29 November 2011, William A. Rowe Jr. wrote: > On 11/28/2011 5:32 PM, William A. Rowe Jr. wrote: > > On 11/28/2011 5:29 PM, Graham Leggett wrote: > >> On 29 Nov 2011, at 01:21, William A. Rowe Jr. wrote: > >>>> - rv = apr_sdbm_nextkey(dbm->file,&rd); > >>>> + apr_sdbm_nextkey(dbm->file,&rd); > >>>> > >>>> pkey->dptr = rd.dptr; > >>>> pkey->dsize = rd.dsize; > >> > >> apr-trunk contains the following explanation for this, I > >> understand it's intended (sf?): > >> > >> /* > >> * XXX: This discards any error but apr_sdbm_nextkey currently > >> returns * XXX: an error for the last key > >> */ > > > > Interesting. Good if that's the only case; it still seems odd ;-)
The error handling of apr_sdbm_nextkey is broken, but I don't remember the details. > FWIW, isn't this invalid on some builds? > > Don't you need to cast the ignored function rv to null? > > Seems to be trading your warning for someone elses' warning. > > E.g. > > (void)apr_sdbm_nextkey(dbm->file, &rd); IMHO this should only be necessary if apr_sdbm_nextkey() had attribute warn_unused_result.
