[PATCH 2/4] Fix error introduced in a15f05f1b43d8e85d9a3f72a0a

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/.

Holger Freyther holger at freyther.de
Sat Jan 30 09:35:00 UTC 2016


> On 28 Jan 2016, at 12:28, suraev at alumni.ntnu.no wrote:
> 

Dear Max,



> The code in bitvec_*_field was incorrectly ported from C++.

and this is why a good commit message is so important. I assumed you had
simply copied the code from the PCU to libosmocore. I had no indication
that you had to change the semantic as part of C++ -> C. It would have
been important to write the thoughts of how you dealt with the C++ reference
and converted it to C.

After looking at the PCU I think the change from reference to pass by value
is a dangerous decision.

	bitvec_write_field(vector, writeIndex, *pui8, no_of_bits);

The code will silently continue to compile and this is why I think the
signature of bitvec_write_field and bitvec_read_field needs to be a pointer
to not have a huge mess with the osmo_pcu code.

holger





More information about the OpenBSC mailing list