Change in libosmocore[master]: add OSMO_STRBUF_PRINTF()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Wed Feb 13 12:37:56 UTC 2019


Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/12880 )

Change subject: add OSMO_STRBUF_PRINTF()
......................................................................


Patch Set 2:

(2 comments)

https://gerrit.osmocom.org/#/c/12880/2/tests/utils/utils_test.c
File tests/utils/utils_test.c:

https://gerrit.osmocom.org/#/c/12880/2/tests/utils/utils_test.c@941
PS2, Line 941: #pragma GCC diagnostic ignored "-Wformat-truncation"
> Why is this necessary? Do we have to use it every time alongside with OSMO_STRBUF_* as well?
I am deliberately testing to write past a buffer's end, with a locally defined buffer, here: ...


https://gerrit.osmocom.org/#/c/12880/2/tests/utils/utils_test.c@958
PS2, Line 958: 	char buf[23];
... and gcc then thinks that it must check the buffer bounds and warn that snprintf() will write past the buffer. Above compiler directive tells it that this is exactly what I want to test and it shouldn't bother checking the bounds for me.



-- 
To view, visit https://gerrit.osmocom.org/12880
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2497514e26c5e7a5d88985fc7e58343be1a027b2
Gerrit-Change-Number: 12880
Gerrit-PatchSet: 2
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-CC: Max <msuraev at sysmocom.de>
Gerrit-Comment-Date: Wed, 13 Feb 2019 12:37:56 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: No
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190213/13a1c331/attachment.htm>


More information about the gerrit-log mailing list