Fix signature of atomic builtins
authorAndreas Schwab <schwab@suse.de>
Fri, 2 Oct 2015 21:03:12 +0000 (23:03 +0200)
committerBen Gamari <ben@smart-cactus.org>
Fri, 2 Oct 2015 21:04:14 +0000 (23:04 +0200)
commite3d2bab86fc89113f8ee65800fdfac81d8d54851
tree7af1543d5472eb235d8f30c474744f2bc1af6163
parent74424346415f4e3a4d888236b3eb993f8aef4c6b
Fix signature of atomic builtins

This patch is due to Andreas Schwab.

This fixes #10926, which reports (on AArch64) errors of the form,

```
/tmp/ghc1492_0/ghc_1.hc:2844:25: warning: passing argument 1 of
'hs_atomic_xor64' makes pointer from integer without a cast
[-Wint-conversion]
     _c1Ho = hs_atomic_xor64((*Sp) + (((Sp[1]) << 0x3UL) + 0x10UL), Sp[2]);
                             ^

In file included from
/home/abuild/rpmbuild/BUILD/ghc-7.10.2/includes/Stg.h:273:0: 0,
                 from /tmp/ghc1492_0/ghc_1.hc:3:

/home/abuild/rpmbuild/BUILD/ghc-7.10.2/includes/stg/Prim.h:41:11:
     note: expected 'volatile StgWord64 *
           {aka volatile long unsigned int *}'
           but argument is of type 'long unsigned int'
     StgWord64 hs_atomic_xor64(volatile StgWord64 *x, StgWord64 val);
               ^
```

Test Plan: Validate

Reviewers: austin, simonmar

Reviewed By: simonmar

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1300

GHC Trac Issues: #10926
includes/stg/Prim.h
libraries/ghc-prim/cbits/atomic.c