[riot-notifications] [RIOT-OS/RIOT] WIP net/sock dns: make header payload pointer c++ compliant (#11302)

llueder notifications at github.com
Fri Sep 27 13:47:28 CEST 2019


llueder commented on this pull request.



>  } sock_dns_hdr_t;
 
+#ifndef __cplusplus
+/**
+ * @brief   DNS internal structure with payload
+ * @extends sock_dns_hdr_t
+ * @details Auxiliary struct that contains a zero-length array as convenience
+ *          pointer to the payload. Only for use in C, invalid in ISO-C++.
+ */
+typedef struct {
+    uint16_t id;        /**< read           */
+    uint16_t flags;     /**< DNS            */
+    uint16_t qdcount;   /**< RFC            */
+    uint16_t ancount;   /**< for            */
+    uint16_t nscount;   /**< detailed       */
+    uint16_t arcount;   /**< explanations   */
+    uint8_t  payload[]; /**< !!             */

Lol, yes of course.
Although when I think about it I like the expressiveness of a having separate struct

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11302#discussion_r329033590
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190927/bc1a7472/attachment.htm>


More information about the notifications mailing list