Attention is currently required from: osmith, fixeria. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/29279 ) Change subject: llc: gprs_llc_hdr_parse(): make the input data pointer const ...................................................................... Patch Set 1: (1 comment) File src/gprs/gprs_llc_parse.c: https://gerrit.osmocom.org/c/osmo-sgsn/+/29279/comment/0d401120_e0cfa9cc PS1, Line 138: ghp->data = (uint8_t *)&ctrl[3];
You are also telling the user that calling the function won't make any kind of modification at any […] The way those functions are writen is controversial and basically reflects some limitations of C (no overloading). Ideally there'd be 2 functions, one const and nother non-const. See for instance https://stackoverflow.com/questions/16860418/why-strrchr-returns-char-instea... I see your point. But I still think in this caseit only confuses readers by pretending this function will not conclude in that buffer being modified at some point after being passed to it. So I really see no advantage in using const there, and a lot of possible drawbacks.
-- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/29279 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: I9757d2be5af589ccbe4d3d406637a33690284754 Gerrit-Change-Number: 29279 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith <osmith@sysmocom.de> Gerrit-CC: pespin <pespin@sysmocom.de> Gerrit-Attention: osmith <osmith@sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy@sysmocom.de> Gerrit-Comment-Date: Wed, 07 Sep 2022 11:32:26 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: fixeria <vyanitskiy@sysmocom.de> Comment-In-Reply-To: pespin <pespin@sysmocom.de> Gerrit-MessageType: comment