[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKgNAkjDmBfR_9-8zZAu2sKDw+dfD4LgokMdLApy-_00ngxnLg@mail.gmail.com>
Date: Tue, 29 Sep 2020 15:38:03 +0200
From: "Michael Kerrisk (man-pages)" <mtk.manpages@...il.com>
To: Alejandro Colomar <colomar.6.4.3@...il.com>
Cc: Stefan Puiu <stefan.puiu@...il.com>,
lnx-man <linux-man@...r.kernel.org>,
lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 12/24] getgrent_r.3: Use sizeof() to get buffer size
(instead of hardcoding macro name)
> 2.- Use sizeof() everywhere, and the macro for the initializer.
>
> pros:
> - It is valid as long as the buffer is an array.
> cons:
> - If the code gets into a function, and the buffer is then a pointer,
> it will definitively produce a silent bug.
Sigh! I just did exactly the last point in a test program I've been writing...
M
Powered by blists - more mailing lists