Project

General

Profile

Actions

Bug #6164

closed

warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

Added by fixeria 8 months ago. Updated 8 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
arehbein
Target version:
-
Start date:
08/31/2023
Due date:
% Done:

100%

Spec Reference:

Description

I am seeing these warnings when building libosmo-netif with gcc v13.2.1:

In file included from ../../../src/libosmo-netif/src/ipa.c:34:
../../../src/libosmo-netif/src/ipa.c: In function 'ipa_check_pull_headers':
../../../src/libosmo-netif/include/osmocom/netif/ipa.h:26:42: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   26 | #define OSMO_IPA_MSGB_CB(__msg)         ((struct osmo_ipa_msgb_cb *)&((__msg)->cb[0]))
      |                                         ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../src/libosmo-netif/include/osmocom/netif/ipa.h:27:41: note: in expansion of macro 'OSMO_IPA_MSGB_CB'
   27 | #define osmo_ipa_msgb_cb_proto(__x)     OSMO_IPA_MSGB_CB(__x)->proto
      |                                         ^~~~~~~~~~~~~~~~
../../../src/libosmo-netif/src/ipa.c:385:9: note: in expansion of macro 'osmo_ipa_msgb_cb_proto'
  385 |         osmo_ipa_msgb_cb_proto(msg) = ih->proto;
      |         ^~~~~~~~~~~~~~~~~~~~~~
../../../src/libosmo-netif/include/osmocom/netif/ipa.h:26:42: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   26 | #define OSMO_IPA_MSGB_CB(__msg)         ((struct osmo_ipa_msgb_cb *)&((__msg)->cb[0]))
      |                                         ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../src/libosmo-netif/include/osmocom/netif/ipa.h:28:41: note: in expansion of macro 'OSMO_IPA_MSGB_CB'
   28 | #define osmo_ipa_msgb_cb_proto_ext(__x) OSMO_IPA_MSGB_CB(__x)->proto_ext
      |                                         ^~~~~~~~~~~~~~~~
../../../src/libosmo-netif/src/ipa.c:397:9: note: in expansion of macro 'osmo_ipa_msgb_cb_proto_ext'
  397 |         osmo_ipa_msgb_cb_proto_ext(msg) = msg->data[0];
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~ 

libosmo-netif.git aede010687c87b8d1b47ca0643528cf39bbda406


Related issues

Related to libosmo-netif - Feature #5753: io_uring support in libosmo-netifResolvedHoernchen11/09/2022

Actions
Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)