Re: MISRA


Abramo Bagnara
 

Il 17/12/21 19:39, Nicolas Pitre ha scritto:
Also in some points I've added /*? shaped comments to points out that the code
sounds very suspect to my eyes (possibly simply because I have not realized
the intention).
Please review https://github.com/zephyrproject-rtos/zephyr/pull/41090
I'm truly sad saying that, but if you keep stating that to write code that has undefined behavior for C standard and such behavior is not a documented compiler extensions is a sane thing to do, I find very hard to find a common ground.

I confess that this is very embarassing for me and I would have hoped to be able to find the right words to explain why this is not sane at all.

It is clear now I've failed and I'm the one to blame for that.

I hope that someone else will succeed where I have failed.

In the specific of your PR: have you considered that if, instead to keep increasing buf, you increase a buffer offset you would avoid to do ugly tricks and NULL subtraction?

--
Abramo Bagnara

BUGSENG srl - http://bugseng.com
mailto:abramo.bagnara@...

Join {devel@lists.zephyrproject.org to automatically receive all group messages.