[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] b2ed57: Eliminate some -Wabsolute-value compiler warnings

GitHub noreply at github.com
Fri Jul 8 22:28:41 UTC 2016


  Branch: refs/heads/Cog
  Home:   https://github.com/OpenSmalltalk/opensmalltalk-vm
  Commit: b2ed57a605047337344f9f3bd6e6e9aa5c3107c5
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/b2ed57a605047337344f9f3bd6e6e9aa5c3107c5
  Author: Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>
  Date:   2016-07-09 (Sat, 09 Jul 2016)

  Changed paths:
    M platforms/Cross/plugins/IA32ABI/dax64business.h

  Log Message:
  -----------
  Eliminate some -Wabsolute-value compiler warnings

sizeField() returns a sqInt.
sqInt is 64bits long on 64bits images.
Taking abs(sqInt) will truncate the size to 32bits.

That's probably benign because the size will rarely exceed 2^31, so we effectively truncate nothing.
But we have a correct way to take absolute value of sqInt (SQABS) and long (labs) so let's just use them and eliminate the false positive warnings.




More information about the Vm-dev mailing list