Bitcoin Forum
September 04, 2024, 08:17:56 PM *
News: Latest Bitcoin Core release: 27.1 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Other / Beginners & Help / CGMiner build warning: always_inline function might not be inlinable on: November 17, 2012, 09:32:39 PM
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]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!