[Toybox] [PATCH] Fix devmem build with clang.

enh enh at google.com
Fri Nov 8 06:10:26 PST 2024


hmm... thinking about this more we don't actually need this condition

      else if (sizeof(long)==8 && bytes==8) data = *(unsigned long *)p;

because we already check that we don't let you set bytes to 8 if you're on
ILP32 (which is good, because _that_ would be a bug).

so we can just write

      else data = *(unsigned long *)p;

here (and in the other "copy" of this if above) and make this go away with
less code? if we do that, we can remove the QUIET from data completely
(because at least with `make defconfig` gcc 13 doesn't complain about this
code at all).

and if we do _that_, then i wonder whether we should keep clang on the
"no-op QUIET" path until/unless we really do need it, to force us to
continue to look at and think about these things? there are very few uses
of QUIET, and it does seem like something we should avoid...

patch attached...

On Thu, Nov 7, 2024 at 10:28 AM enh <enh at google.com> wrote:

>
> ---
>  lib/portability.h | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20241108/e95c6815/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-devmem.c-simplify-the-8-byte-long-support.patch
Type: application/octet-stream
Size: 1850 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20241108/e95c6815/attachment-0001.obj>


More information about the Toybox mailing list