[Vm-dev] longRunningPrimitiveCheckSequenceNumber compiler warning

Eliot Miranda eliot.miranda at gmail.com
Fri Jan 4 16:04:14 UTC 2019


Hi Nicolas,

On Fri, Jan 4, 2019 at 3:39 AM Nicolas Cellier <
nicolas.cellier.aka.nice at gmail.com> wrote:

>
> We have this code
>
> voidLongRunningPrimitive: reason
>     ...
>     <inline: false>
>     longRunningPrimitiveCheckMethod := nil.
>     longRunningPrimitiveCheckSequenceNumber = 0. "not strictly necessary
> but prevents this being inlined into checkForLongRunningPrimitive"
>    ...
>
> which generates
>
> static void NoDbgRegParms
> voidLongRunningPrimitive(char *reason)
> {   DECL_MAYBE_SQ_GLOBAL_STRUCT
>     GIV(longRunningPrimitiveCheckMethod) = null;
>     GIV(longRunningPrimitiveCheckSequenceNumber) == 0;
>    ...
>
> and a compiler warning suggesting to replace == with =
> So it seems to effectively be a hack, but it seems fragile.
> Couldn't we remove this line (don't we have inline: #never for that
> purpose?).
>

Yes.  When I wrote the code we didn't have inline: #never.  inline: #never
is a much better solution.

_,,,^..^,,,_
best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20190104/83891461/attachment.html>


More information about the Vm-dev mailing list