[PATCH] uqmi: fix compilation with GCC12

Bjørn Mork bjorn at mork.no
Sun Aug 21 08:02:39 PDT 2022


Hauke Mehrtens <hauke at hauke-m.de> writes:

> GCC complains about this code because the pointer is only removed
> conditionally
> -------------------------------------------
> 	if (req->complete == &complete)
> 		req->complete = NULL;
> -------------------------------------------
> https://git.openwrt.org/?p=project/uqmi.git;a=blob;f=dev.c;h=bd1020790f844fd364fd753135acd8f53f34d996;hb=HEAD#l229


Yes, but that condition is testing for precisely the dangling
pointer.GCC complains about.  If it is false, then there is no
problem. If it is true, then the pointer is removed and there is no
problem.

If GCC is unable to figure that out, then it should not try.


Bjørn



More information about the openwrt-devel mailing list