Whamcloud - gitweb
libext2fs: use statement-expression for container_of only on GNU-compatible compilers
authorMichael Forney <mforney@mforney.org>
Wed, 14 Apr 2021 07:41:27 +0000 (00:41 -0700)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 6 Jul 2021 00:22:57 +0000 (20:22 -0400)
commit9d5fdcc5db1b5246028dc871e5f0fb908dd64771
treef6a55c07a96b4798ad4e0ff576c57bebf4a76cd0
parentf11448318f99aa5fde27aea6b73420d6c495a4f6
libext2fs: use statement-expression for container_of only on GNU-compatible compilers

Functionally, the statement-expression is not necessary here; it
just gives a bit of type-safety to make sure the pointer really
does have a compatible type with the specified member of the struct.

When statement expressions are not available, we can just use a
portable fallback macro that skips this member type check.

Signed-off-by: Michael Forney <mforney@mforney.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/compiler.h