[riot-notifications] [RIOT-OS/RIOT] cc2420/gnrc_netif: Adds crc_valid to netif (#8276)

Martine Lenders notifications at github.com
Thu Jul 25 14:43:38 CEST 2019

miri64 commented on this pull request.

> @@ -90,7 +90,7 @@ static inline bool _already_received(gnrc_netif_t *netif,
 static gnrc_pktsnip_t *_recv(gnrc_netif_t *netif)
     netdev_t *dev = netif->dev;
-    netdev_ieee802154_rx_info_t rx_info;
+    netdev_ieee802154_rx_info_t rx_info = { .crc_valid = 0 };

> So you are saying that `netdev_ieee802154_rx_info_t rx_info = { .crc_valid = 0 };` initializes the whole structure with `0`? (And I'm not talking about some smart compiler things going on in the background)

To say it semantically correct:  `struct foobar foo = { .field = x }` initializes `field` with `x` and all fields of `foobar` that are not provided with 0. So in the case above, yes it initializes the whole struct with 0 (AFAIK in the background most compilers solve this by just implicitly calling `memset()` though). See https://en.cppreference.com/w/c/language/struct_initialization for reference.

> How about we wait until someone opens the follow-up PR and then we both consecutively?

See #9755 for `at86rf2xx`

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190725/2aba6ec8/attachment.htm>

More information about the notifications mailing list