two general code review questions

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/OpenBSC@lists.osmocom.org/.

Neels Hofmeyr nhofmeyr at sysmocom.de
Thu Jan 17 16:58:35 UTC 2019


On Thu, Jan 17, 2019 at 05:50:05PM +0100, Neels Hofmeyr wrote:
> Should we now put copyright comments in header files as well?
> re https://gerrit.osmocom.org/c/osmo-msc/+/11642/3/include/osmocom/msc/sgs_iface.h#2
> 
> When I see structs containing talloc'd char*, should I generally give code
> review to use fixed char arrays instead? I think it ends up being simpler
> semantically as well as better in terms of mem allocation. Right?  e.g.
> https://gerrit.osmocom.org/c/osmo-msc/+/11642/30/include/osmocom/msc/sgs_server.h#18
> and #21

From IRC:

<LaF0rge> neels: it depends. if the size is bounded, and we always need that string as part of the enclosing struct: array.
<LaF0rge> neels: if the size is very dynamic/unknown/unbounded, and the char string is rather optional and not present in most cases: dynamic allocation

~N
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.osmocom.org/pipermail/openbsc/attachments/20190117/38b1f9bd/attachment.bin>


More information about the OpenBSC mailing list