cilynx / rtl88x2bu

rtl88x2bu driver updated for current kernels.
http://www.wolfteck.com/2018/02/22/wsky_1200mbps_wireless_usb_wifi_adapter/
GNU General Public License v2.0
1.61k stars 316 forks source link

How to resolve compilation issues with GCC 12.1 #214

Closed MaxG87 closed 1 year ago

MaxG87 commented 1 year ago

GCC 12 improved its detection of tautological conditions and aborts if it finds one. This is mostly related to checks of pointer addresses which are guaranteed to be set. In most cases it seems as if not the pointer address but a value in the array the pointer points to should be checked.

I already created the branch fix-gcc12 and fixed some occasions. However, I could use some advices.

In some places I tried to fix the seemingly erroneous comparison. This means that I altered the behaviour of the code. I did not yet manage to use these changes on my own. Anyhow, if anyone could check these changes too or does better understand what the appropriate fix would be, I would be glad to get some response.

Now there are plenty of occasions in hal/phydm/phydm_soml.c and hal/phydm/phydm_debug.c left. I have no clue what a fix for these would look like. I am tempted to just suppress the corresponding error. I really would appreciate to get some advice how to fix this.

MaxG87 commented 1 year ago

I merged the changes. Please open a new issue if you think a regression was introduced.