On 11/07/14 21:54, Kurt Roeckx via RT wrote: > On Fri, Nov 07, 2014 at 11:47:23AM +0100, Kraft, Matthias via RT wrote: >> Hi OpenSSL team, >> >> in an overly eager attempt to fix the compile errors of OpenSSL 0.9.8zc I >> applied all commits that meanwhile arrived against OpenSSL_0_9_8-stable. I >> found that the first change in a2ca66f37c97b611feb56b9b753f380827541683 >> introduces a new problem when compiling for Windows 32bit: >> >> cl /Fotmp32dll\rsa_pk1.obj -Iinc32 -Itmp32dll /MD /Ox /O2 /Ob2 /W3 >> /WX /Gs0 /GF /Gy /nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN >> -DL_ENDIAN -DDSO_WIN32 -D_CRT_SECURE_NO_DEPRECATE >> -D_CRT_NONSTDC_NO_DEPRECATE -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 >> -DAES_ASM -DBN_ASM -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_BN_ASM_MONT >> -DMD5_ASM -DSHA1_ASM -DRMD160_ASM -DOPENSSL_USE_APPLINK -I. /Fdout32dll >> -DOPENSSL_NO_IDEA -DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_SEED -DOPENSSL_NO_RC5 >> -DOPENSSL_NO_MDC2 -DOPENSSL_NO_CMS -DOPENSSL_NO_JPAKE -DOPENSSL_NO_CAPIENG >> -DOPENSSL_NO_KRB5 -DOPENSSL_NO_DYNAMIC_ENGINE -D_WINDLL >> -DOPENSSL_BUILD_SHLIBCRYPTO -c .\crypto\rsa\rsa_pk1.c >> rsa_pk1.c >> tmp32dll\constant_time_locl.h(132) : error C2220: warning treated as error - >> no 'object' file generated >> tmp32dll\constant_time_locl.h(132) : warning C4146: unary minus operator >> applied to unsigned type, result still unsigned >> NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio >> 10.0\VC\BIN\cl.EXE"' : return code '0x2' >> Stop. >> >> After reverting this commit the compile and tests are ok again. > > So that seems to be: > return -(a >> (sizeof(unsigned int) * 8 - 1)); > > Could you try this instead? > return 0-(a >> (sizeof(unsigned int) * 8 - 1)); >
This would work, yes. And while we're at it. I'd suggest sizeof(a) in this case, as it's more readable. ______________________________________________________________________ OpenSSL Project http://www.openssl.org Development Mailing List openssl-dev@openssl.org Automated List Manager majord...@openssl.org