[PATCH] compiler warning: pointer type in OCTET_STRING_noalloc()

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

Harald Welte laforge at gnumonks.org
Fri Apr 15 19:49:55 UTC 2016


Hi Neels,

On Thu, Apr 14, 2016 at 02:45:56PM +0200, Neels Hofmeyr wrote:
> It's useless to declare the str arg as const when all the function does is
> assign it to a non-const pointer.

The point of doing it this way is that we don't have to write our code
in a sub-standard way, just because asn1c is written in a way that you
cannot have 'const' buffers as input into encoding.

So 'const' here is used as a hint to the programmer, that a read-only
string is passed into this function, and hence it is input data.

So this was very intentional.  Now you can argue that my line of
thinking above is basically ignoring the reality of asn1c.  But then,
don't we have actual real issues to address, than to debate about thing
slike this?  Sorry...

-- 
- Harald Welte <laforge at gnumonks.org>           http://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
                                                  (ETSI EN 300 175-7 Ch. A6)



More information about the OpenBSC mailing list