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 <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Max <[email protected]>
Gerrit-Reviewer: Vadim Yanitskiy <[email protected]>
Gerrit-Comment-Date: Tue, 29 Jan 2019 10:23:47 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes

Reply via email to