Change in libosmocore[master]: logging sanity: initialize osmo_log_info = NULL

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

Harald Welte gerrit-no-reply at lists.osmocom.org
Tue Jan 29 10:23:47 UTC 2019


Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/12714 )

Change subject: logging sanity: initialize osmo_log_info = NULL
......................................................................


Patch Set 3: Code-Review-1

(1 comment)

https://gerrit.osmocom.org/#/c/12714/3/src/logging.c
File src/logging.c:

https://gerrit.osmocom.org/#/c/12714/3/src/logging.c@60
PS3, Line 60: log_info *osmo_log_info = NULL
to my knowledge this is not required at all.

https://en.wikipedia.org/wiki/.bss
"Unix-like systems and Windows initialize the bss section to zero, allowing C and C++ statically-allocated variables initialized to values represented with all bits zero to be put in the bss segment"

Also, from the C specification:

In C code, any variable with static storage duration is defined to be initialized to 0 by the spec (Section 6.7.8 Initialization, paragraph 10):

If an object that has static storage duration is not initialized explicitly, then:

* if it has pointer type, it is initialized to a null pointer;
* if it has arithmetic type, it is initialized to (positive or unsigned) zero;
* if it is an aggregate, every member is initialized (recursively) according to these rules;
* if it is a union, the first named member is initialized (recursively) according to these rules.



-- 
To view, visit https://gerrit.osmocom.org/12714
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: Ifd97c945f63cfe9850f025db7e69370866ea133e
Gerrit-Change-Number: 12714
Gerrit-PatchSet: 3
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Comment-Date: Tue, 29 Jan 2019 10:23:47 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190129/48a70c14/attachment.htm>


More information about the gerrit-log mailing list