[PATCH v2 2/2] test: unit test for longjmp

Heinrich Schuchardt xypron.glpk at gmx.de
Wed Mar 24 14:28:47 CET 2021


On 24.03.21 13:39, Andreas Schwab wrote:
> On Mär 24 2021, Heinrich Schuchardt wrote:
>
>> And foo is obviously "changed  between the setjmp invocation and longjmp
>> call".
>>
>> The current version of the patch is:
>> https://patchwork.ozlabs.org/project/uboot/patch/20210323181127.32411-3-xypron.glpk@gmx.de/
>>
>> So I guess we have to declare env as volatile in setjmp() in this
>> version of the patch because it is changed between the setjmp and
>> longjmp invocations?
>
> Yes, I think so, or make it static.

The whole point of this variable during test is that it lives on the
stack. So static is not what I am looking for.

Actually adding volatile does not change the generated machine code
because test_longjmp() is marked as noinline and therefore has its own
stack frame separated from test_setjmp().

But adding volatile adds to the portability. So I will respin the series.

Best regards

Heinrich


More information about the U-Boot mailing list