You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/07/31 11:50:36 UTC

[GitHub] [incubator-nuttx] hartmannathan commented on a diff in pull request #6725: include: Fixed null struct may caused build issue.

hartmannathan commented on code in PR #6725:
URL: https://github.com/apache/incubator-nuttx/pull/6725#discussion_r933974303


##########
include/nuttx/net/netdev.h:
##########
@@ -272,6 +272,7 @@ struct net_driver_s
 
     struct netdev_varaddr_s radio;
 #endif
+    uint8_t unused;    /* it's empty structure if all above defines avoid. */

Review Comment:
   Alternate suggestion:
   
   ```
   #if defined(CONFIG_NET_ETHERNET) || defined(CONFIG_NET_6LOWPAN) || \
       defined(CONFIG_NET_BLUETOOTH) || defined(CONFIG_NET_IEEE802154)
     union
     {
   #ifdef CONFIG_NET_ETHERNET
       /* Ethernet device identity */
       struct ether_addr ether;    /* Device Ethernet MAC address */
   #endif
   
   
   #if defined(CONFIG_NET_6LOWPAN) || defined(CONFIG_NET_BLUETOOTH) || \
       defined(CONFIG_NET_IEEE802154)
     /* The address assigned to an IEEE 802.15.4 or generic packet radio. */
   
        struct netdev_varaddr_s radio;
   #endif
      } d_mac;
   #endif
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org