Skip to content
  • Andreas Schwab's avatar
    Fix signature of atomic builtins · e3d2bab8
    Andreas Schwab authored and Ben Gamari's avatar Ben Gamari committed
    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
    e3d2bab8