[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Two compiler warnings on master
From: |
Eli Zaretskii |
Subject: |
Re: Two compiler warnings on master |
Date: |
Thu, 30 Jan 2025 11:07:24 +0200 |
> Date: Thu, 30 Jan 2025 09:31:57 +0100
> From: martin rudalics <rudalics@gmx.at>
>
> Since a couple of days building master with gcc 12.2.0 gets me
>
> In function ‘dump_write’,
> inlined from ‘dump_do_fixup’ at ../../src/pdumper.c:4062:5,
> inlined from ‘dump_do_fixups’ at ../../src/pdumper.c:4076:7,
> inlined from ‘Fdump_emacs_portable’ at ../../src/pdumper.c:4342:3:
> ../../src/pdumper.c:783:3: warning: ‘dump_value’ may be used uninitialized
> [-Wmaybe-uninitialized]
> 783 | memcpy ((char *)ctx->buf + ctx->offset, buf, nbyte);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../../src/pdumper.c: In function ‘Fdump_emacs_portable’:
> ../../src/pdumper.c:3993:12: note: ‘dump_value’ was declared here
> 3993 | intptr_t dump_value;
> | ^~~~~~~~~~
>
> Is the compiler wrong?
It's wrong, yes. I installed something to pacify it, please check.
> And a warning I see for quite some time already is
>
> ../../src/eval.c: In function ‘internal_catch_all’:
> ../../src/eval.c:1737:19: warning: variable ‘c’ might be clobbered by
> ‘longjmp’ or ‘vfork’ [-Wclobbered]
> 1737 | struct handler *c = handlerlist->nextfree;
> | ^
>
> To be ignored?
Not sure (there are other similar functions where there's no
warning). Paul, WDYT?