chiark / gitweb /
barrier: suppress false-positive warning
authorDavid Herrmann <dh.herrmann@gmail.com>
Sat, 19 Jul 2014 09:32:25 +0000 (11:32 +0200)
committerDavid Herrmann <dh.herrmann@gmail.com>
Sat, 19 Jul 2014 09:32:25 +0000 (11:32 +0200)
If poll() returns, one of both revents must be set, thus "buf" is set by
either clause. This is non-obvious for code-checkers so add an "else
continue;" clause to suppress "uninitialized variable" warnings.

src/shared/barrier.c

index 4ac42d023943cd2d76d17b46f4287c9f582e8a7f..4a5544de27d309f0593c34d5fc4e1ccba06d0985 100644 (file)
@@ -257,6 +257,8 @@ static bool barrier_read(Barrier *b, int64_t comp) {
                          * guarantees that exit-abortions do not overwrite real
                          * barriers. */
                         buf = BARRIER_ABORTION;
+                else
+                        continue;
 
                 /* lock if they aborted */
                 if (buf >= (uint64_t)BARRIER_ABORTION) {