esp_rom: esp32s2: suppress -Waddress-of-packed-member warning
@@ -49,6 +49,10 @@ void rom_usb_cdc_set_descriptor_patch(void)
uint8_t mac_bytes[6];
efuse_hal_get_mac(mac_bytes);
/* Convert to UTF16 string */
+#pragma GCC diagnostic push
+#if __GNUC__ >= 9
+#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
+#endif
uint16_t* dst = s_str_serial_descr.bString;
for (int i = 0; i < 6; ++i) {
uint8_t b = mac_bytes[5 - i]; /* printing from the MSB */
@@ -56,6 +60,7 @@ void rom_usb_cdc_set_descriptor_patch(void)
*dst++ = nibble_to_hex_u16(b & 0xf);
dst++;
}
+#pragma GCC diagnostic pop
/* Override the pointer to descriptors structure */
rom_usb_curr_desc = &s_acm_usb_descriptors_override;
