Bitcoin Forum
September 04, 2024, 08:18:12 PM *
News: Latest Bitcoin Core release: 27.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: CGMiner build warning: always_inline function might not be inlinable  (Read 1542 times)
stozher (OP)
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
November 17, 2012, 09:32:39 PM
Last edit: November 18, 2012, 10:25:36 PM by stozher
 #1

Code:
sha256_4way.c:54:49: warning: always_inline function might not be inlinable [-Wattributes]
sha256_4way.c:50:48: warning: always_inline function might not be inlinable [-Wattributes]

The '__attribute__((always_inline))' does not strictly imply 'inline'. Newer versions of GCC detect this misuse and issue
the above warning. Including the missing 'inline' resolves the build warning.

Code:
cd /path-to-build-folder
git clone git://github.com/ckolivas/cgminer.git
patch -p0 < git+d4af2d0535.patch

/path-to-build-folder/git+d4af2d0535.patch
Code:
--- cgminer/sha256_4way.c.orig
+++ cgminer/sha256_4way.c
@@ -47,11 +47,11 @@
     return _mm_xor_si128(_mm_xor_si128(_mm_and_si128(b,c),_mm_and_si128(b,d)),_mm_and_si128(c,d));
 }
 
-static __attribute__((always_inline)) __m128i  ROTR(__m128i x, const int n) {
+static inline __attribute__((always_inline)) __m128i  ROTR(__m128i x, const int n) {
     return _mm_or_si128(_mm_srli_epi32(x, n),_mm_slli_epi32(x, 32 - n));
 }
 
-static  __attribute__((always_inline))  __m128i SHR(__m128i x, const int n) {
+static inline __attribute__((always_inline))  __m128i SHR(__m128i x, const int n) {
     return _mm_srli_epi32(x, n);
 }
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!