[OpenWrt-Devel] [PATCH uci 2/2] build: Add -Wclobbered to detect problems with longjmp

Hauke Mehrtens hauke at hauke-m.de
Thu Nov 7 17:51:50 EST 2019

On 11/7/19 9:51 AM, Petr Štetiar wrote:
> Hauke Mehrtens <hauke at hauke-m.de> [2019-11-07 00:26:23]:
> Hi,
>>> I didn't looked deeper, but GCC 6,7,8,9 on x86/64 reports following:
>>>  list.c:626:21: error: variable ‘prev’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered]
>>>   626 |  struct uci_option *prev = NULL;
>>>       |                     ^~~~
>>>  list.c:627:14: error: variable ‘value2’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered]
>>>   627 |  const char *value2 = NULL;
>>>       |              ^~~~~~
>> I think I also saw these problems in my manual review, but the
>> -Wclobbered did not complain about them for me with gcc 8.3 on MIPS.
> Interesting, out of curiosity which MIPS? BTW I see a consistent gcc 8.3
> behaviour[1] across all CI testing targets (ath79, malta be, imx6, armada
> a-53) with -Wextra and without your patch applied.  You need to click on the
> "[x] Failed" button in order to see the build failure.
> 1. https://gitlab.com/ynezz/openwrt-uci/pipelines/94051766/builds

I also saw these and they are fixed in my patch by adding a volatile
which is the correct fix for these problems.

It was something else where I saw some potential problem in the review,
but GCC was not warning about, as far as I know.

How do we want to go forward with these patches?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20191107/4cb66198/attachment.sig>
-------------- next part --------------
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list