]> git.ipfire.org Git - thirdparty/shadow.git/commit
sizeof.h: Make NITEMS() and derivative macros safe against pointers
authorAlejandro Colomar <alx@kernel.org>
Sun, 30 Jul 2023 12:26:27 +0000 (14:26 +0200)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Fri, 1 Sep 2023 07:39:23 +0000 (09:39 +0200)
commit49ea7327d96d1f5793fdd9b5c2bd1d6e252b3f6b
tree4a5663c8ca5ec5865d2aba168706f145f326105e
parentc3a8d02b9f66763b3ef1756ba1dec4e9b039d14e
sizeof.h: Make NITEMS() and derivative macros safe against pointers

By using must_be_array(), code that calls NITEMS() or STRLEN() with
non-arrays will not compile.

Link: <https://stackoverflow.com/a/57537491>
Cc: Christian Göttsche <cgzones@googlemail.com>
Cc: Serge Hallyn <serge@hallyn.com>
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/sizeof.h