Hello, Am Sonntag, den 16.06.2013, 01:40 -0400 schrieb Rich Felker: > On Sun, Jun 16, 2013 at 12:16:27AM +0200, Szabolcs Nagy wrote: > > * Jens Gustedt [2013-06-16 00:01:20 +0200]: > > > got_err was only set to 1 in case of error, but never written > > > otherwise. > > > > i wonder why gcc -Wmaybe-uninitialized does not catch this > > Indeed, this is very strange. Anyway, I'm committing the fix. Looking a bit deeper into it, I think this is not only strange but suspicious. First, this means that we have not enough coverage for the aio routines to find simple bugs like that one. aio isn't much used, obviously. But then I also checked with clang, and it doesn't find this either. First, I thought that the control flow surrounding this must be fundamentally flawed if the compilers aren't capable to track such simple cases of uninitialized variables. But even by simplifying, it doesn't trigger, so I am not sure what is going on. It makes not much sense to me to have an infinite loop at the outside. I think the control flow should merely be something as below. Still I am not sure that the strategy of continuing after an error has been detected is paying something. I would be more in favor in erroring out as early as possible and return err in errno to let the application know that there was a problem. Waiting until we checked everybody and then returning EIO is throwing away information. Jens static int lio_wait(struct lio_state *st) { int got_err = 0; struct aiocb **const cbs = st->cbs; for (int i=0, cnt = st->cnt; i