commit | 22ade291ad8f90dc5e4581630bfae21bfd1dcdc3 | [log] [tgz] |
---|---|---|
author | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | Fri Feb 24 18:00:13 2023 +0700 |
committer | fixeria <vyanitskiy@sysmocom.de> | Mon Feb 27 09:58:46 2023 +0000 |
tree | 3935c829fb31d6a8706e2ed506920ff82423c303 | |
parent | 65e0edc73fa921632641463f82a7df2fa15ad7d8 [diff] |
msgb: use OSMO_ASSERT in msgb_alloc_headroom[_c]() This patch is a preparation for the upcoming change making use of the built-in static_assert(), which is available since C11. When using built-in static_assert(), gcc v12.2.1 fails: include/osmocom/core/msgb.h: In function 'msgb_alloc_headroom_c': include/osmocom/core/msgb.h:532:33: error: expression in static assertion is not constant 532 | osmo_static_assert(size >= headroom, headroom_bigger); include/osmocom/core/utils.h:86:24: note: in definition of macro 'osmo_static_assert' 86 | static_assert((exp), "(" #exp ") failed") | ^~~ include/osmocom/core/msgb.h: In function 'msgb_alloc_headroom': include/osmocom/core/msgb.h:554:33: error: expression in static assertion is not constant 554 | osmo_static_assert(size >= headroom, headroom_bigger); include/osmocom/core/utils.h:86:24: note: in definition of macro 'osmo_static_assert' 86 | static_assert((exp), "(" #exp ") failed") | ^~~ These are not really *static* assert()s, because they operate on the user supplied arguments 'size' and 'headroom', which are not guaranteed to be integer literals. Neither they trigger compilation failures as expected, nor do they abort at run-time. They simply do nothing. Change-Id: I17ef4f3283ce20a5b452b7874c826acfb02a0123
This repository contains a set of C-language libraries that form the core infrastructure of many Osmocom Open Source Mobile Communications projects.
Historically, a lot of this code was developed as part of the OpenBSC project, but which are of a more generic nature and thus useful to (at least) other programs that we develop in the sphere of Free Software / Open Source mobile communications.
There is no clear scope of it. We simply move all shared code between the various Osmocom projects in this library to avoid code duplication.
The libosmocore.git repository build multiple libraries:
The official homepage of the project is https://osmocom.org/projects/libosmocore/wiki/Libosmocore
You can clone from the official libosmocore.git repository using
git clone https://gitea.osmocom.org/osmocom/libosmocore
There is a web interface at https://gitea.osmocom.org/osmocom/libosmocore
Doxygen-generated API documentation is generated during the build process, but also available online for each of the sub-libraries at https://ftp.osmocom.org/api/latest/libosmocore/
Discussions related to libosmocore are happening on the openbsc@lists.osmocom.org mailing list, please see https://lists.osmocom.org/mailman/listinfo/openbsc for subscription options and the list archive.
Please observe the Osmocom Mailing List Rules when posting.
Our coding standards are described at https://osmocom.org/projects/cellular-infrastructure/wiki/Coding_standards
We us a gerrit based patch submission/review process for managing contributions. Please see https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit for more details
The current patch queue for libosmocore can be seen at https://gerrit.osmocom.org/#/q/project:libosmocore+status:open