From: Victor Porton <porton@narod.ru>
Subject: Re: Strict aliasing, is it OK?
Date: Tue, 04 Jul 2017 23:13:50 +0300
Date: 2017-07-04T23:13:50+03:00 [thread overview]
Message-ID: <ojgsul$1hcl$1@gioia.aioe.org> (raw)
In-Reply-To: ojgsov$1h57$1@gioia.aioe.org
Victor Porton wrote:
> I do unchecked conversions (in both directions) between Handle_Type and
> My_Dummy_Access.
>
> Everytime I refer to Handle_Type, it is real Handle_Type.
>
> But there is several Handle_Type (defined in different packages). Let us
> denote them Handle_Type1, Handle_Type2, Handle_Type3, ...
>
> When I refer to My_Dummy_Access it may be any one of Handle_Type1,
> Handle_Type2, Handle_Type3, ...
>
> But I never convert Handle_TypeN into Handle_TypeM for N/=M.
>
> I also never use My_Dummy_Access to anything except to convert it into
> Handle_TypeX.
Or (I forgotten that) I also may pass My_Dummy_Access to an imported C
function.
> Question: Are these restrictions enough for the compiler to the right
> thing (that is not something counterintuitive)?
>
> What is the right fix for the warning? Shall I add pragma
> No_Strict_Aliasing?
>
--
Victor Porton - http://portonvictor.org
next prev parent reply other threads:[~2017-07-04 20:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-04 17:49 Strict aliasing, is it OK? Victor Porton
2017-07-04 17:50 ` Victor Porton
2017-07-04 18:06 ` Victor Porton
2017-07-04 18:15 ` Niklas Holsti
2017-07-04 18:30 ` Victor Porton
2017-07-04 19:29 ` Niklas Holsti
2017-07-04 20:11 ` Victor Porton
2017-07-04 20:13 ` Victor Porton [this message]
2017-07-04 21:41 ` Simon Wright
2017-07-04 23:39 ` Victor Porton
2017-07-05 9:49 ` Simon Wright
2017-07-08 17:29 ` Robert Eachus
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox