]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rados: Add noreturn attribute to silence uninitialized warning 19348/head
authorAdam C. Emerson <aemerson@redhat.com>
Tue, 5 Dec 2017 19:29:48 +0000 (14:29 -0500)
committerAdam C. Emerson <aemerson@redhat.com>
Tue, 5 Dec 2017 20:03:01 +0000 (15:03 -0500)
Marking the `usage_exit` function as noreturn lets the compiler know
that execution won't continue beyond the statement where it's called,
so the path that would lead to the variables being used uninitialized
doesn't count.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/tools/rados/rados.cc

index 6e7a3a74ae3f33033339de2f6afec7ca15869237..9c6baeb75dd02881c8c1a6676e7897470920ce5f 100644 (file)
@@ -235,7 +235,7 @@ void usage(ostream& out)
 
 unsigned default_op_size = 1 << 22;
 
-static void usage_exit()
+[[noreturn]] static void usage_exit()
 {
   usage(cerr);
   exit(1);