Source: freerdp Version: 1.1.0~git20140921.1.440916e+dfsg1-5 Severity: important Justification: fails to build from source (but built in past) User: debian-al...@lists.debian.org Usertags: alpha
Freerdp FTBFS on Alpha with a failure in the test suite [1]: Start 65: TestUnicodeConversion 65/90 Test #65: TestUnicodeConversion ...................***Failed 0.00 sec Running the test suite manually reveals that the results are actually correct, it is the comparison routine that returns a failure despite correct results. This comes about because the comparison routine (_wcscmp()) expects arguments as WCHAR, however the reference string is declared BYTE, thus gets byte alignment not wchar alignment. The attached patch declares all reference strings with the new C11 _Alignas keyword. With that freerdp compiles to completion on Alpha. Cheers Michael. [1] https://buildd.debian.org/status/fetch.php?pkg=freerdp&arch=alpha&ver=1.1.0~git20140921.1.440916e%2Bdfsg1-5&stamp=1442015809
Index: freerdp-1.1.0~git20140921.1.440916e+dfsg1/winpr/libwinpr/crt/test/TestUnicodeConversion.c =================================================================== --- freerdp-1.1.0~git20140921.1.440916e+dfsg1.orig/winpr/libwinpr/crt/test/TestUnicodeConversion.c +++ freerdp-1.1.0~git20140921.1.440916e+dfsg1/winpr/libwinpr/crt/test/TestUnicodeConversion.c @@ -1,5 +1,6 @@ #include <stdio.h> +#include <stdalign.h> #include <winpr/crt.h> #include <winpr/error.h> #include <winpr/windows.h> @@ -19,19 +20,19 @@ /* Letters */ static BYTE c_cedilla_UTF8[] = "\xC3\xA7\x00"; -static BYTE c_cedilla_UTF16[] = "\xE7\x00\x00\x00"; +static _Alignas(WCHAR) BYTE c_cedilla_UTF16[] = "\xE7\x00\x00\x00"; static int c_cedilla_cchWideChar = 2; static int c_cedilla_cbMultiByte = 3; /* English */ static BYTE en_Hello_UTF8[] = "Hello\0"; -static BYTE en_Hello_UTF16[] = "\x48\x00\x65\x00\x6C\x00\x6C\x00\x6F\x00\x00\x00"; +static _Alignas(WCHAR) BYTE en_Hello_UTF16[] = "\x48\x00\x65\x00\x6C\x00\x6C\x00\x6F\x00\x00\x00"; static int en_Hello_cchWideChar = 6; static int en_Hello_cbMultiByte = 6; static BYTE en_HowAreYou_UTF8[] = "How are you?\0"; -static BYTE en_HowAreYou_UTF16[] = "\x48\x00\x6F\x00\x77\x00\x20\x00\x61\x00\x72\x00\x65\x00\x20\x00" +static _Alignas(WCHAR) BYTE en_HowAreYou_UTF16[] = "\x48\x00\x6F\x00\x77\x00\x20\x00\x61\x00\x72\x00\x65\x00\x20\x00" "\x79\x00\x6F\x00\x75\x00\x3F\x00\x00\x00"; static int en_HowAreYou_cchWideChar = 13; static int en_HowAreYou_cbMultiByte = 13; @@ -39,12 +40,12 @@ static int en_HowAreYou_cbMultiByte = 13 /* French */ static BYTE fr_Hello_UTF8[] = "Allo\0"; -static BYTE fr_Hello_UTF16[] = "\x41\x00\x6C\x00\x6C\x00\x6F\x00\x00\x00"; +static _Alignas(WCHAR) BYTE fr_Hello_UTF16[] = "\x41\x00\x6C\x00\x6C\x00\x6F\x00\x00\x00"; static int fr_Hello_cchWideChar = 5; static int fr_Hello_cbMultiByte = 5; static BYTE fr_HowAreYou_UTF8[] = "\x43\x6F\x6D\x6D\x65\x6E\x74\x20\xC3\xA7\x61\x20\x76\x61\x3F\x00"; -static BYTE fr_HowAreYou_UTF16[] = "\x43\x00\x6F\x00\x6D\x00\x6D\x00\x65\x00\x6E\x00\x74\x00\x20\x00" +static _Alignas(WCHAR) BYTE fr_HowAreYou_UTF16[] = "\x43\x00\x6F\x00\x6D\x00\x6D\x00\x65\x00\x6E\x00\x74\x00\x20\x00" "\xE7\x00\x61\x00\x20\x00\x76\x00\x61\x00\x3F\x00\x00\x00"; static int fr_HowAreYou_cchWideChar = 15; static int fr_HowAreYou_cbMultiByte = 16; @@ -52,12 +53,12 @@ static int fr_HowAreYou_cbMultiByte = 16 /* Russian */ static BYTE ru_Hello_UTF8[] = "\xD0\x97\xD0\xB4\xD0\xBE\xD1\x80\xD0\xBE\xD0\xB2\xD0\xBE\x00"; -static BYTE ru_Hello_UTF16[] = "\x17\x04\x34\x04\x3E\x04\x40\x04\x3E\x04\x32\x04\x3E\x04\x00\x00"; +static _Alignas(WCHAR) BYTE ru_Hello_UTF16[] = "\x17\x04\x34\x04\x3E\x04\x40\x04\x3E\x04\x32\x04\x3E\x04\x00\x00"; static int ru_Hello_cchWideChar = 8; static int ru_Hello_cbMultiByte = 15; static BYTE ru_HowAreYou_UTF8[] = "\xD0\x9A\xD0\xB0\xD0\xBA\x20\xD0\xB4\xD0\xB5\xD0\xBB\xD0\xB0\x3F\x00"; -static BYTE ru_HowAreYou_UTF16[] = "\x1A\x04\x30\x04\x3A\x04\x20\x00\x34\x04\x35\x04\x3B\x04\x30\x04" +static _Alignas(WCHAR) BYTE ru_HowAreYou_UTF16[] = "\x1A\x04\x30\x04\x3A\x04\x20\x00\x34\x04\x35\x04\x3B\x04\x30\x04" "\x3F\x00\x00\x00"; static int ru_HowAreYou_cchWideChar = 10; static int ru_HowAreYou_cbMultiByte = 17; @@ -66,14 +67,14 @@ static int ru_HowAreYou_cbMultiByte = 17 static BYTE ar_Hello_UTF8[] = "\xD8\xA7\xD9\x84\xD8\xB3\xD9\x84\xD8\xA7\xD9\x85\x20\xD8\xB9\xD9" "\x84\xD9\x8A\xD9\x83\xD9\x85\x00"; -static BYTE ar_Hello_UTF16[] = "\x27\x06\x44\x06\x33\x06\x44\x06\x27\x06\x45\x06\x20\x00\x39\x06" +static _Alignas(WCHAR) BYTE ar_Hello_UTF16[] = "\x27\x06\x44\x06\x33\x06\x44\x06\x27\x06\x45\x06\x20\x00\x39\x06" "\x44\x06\x4A\x06\x43\x06\x45\x06\x00\x00"; static int ar_Hello_cchWideChar = 13; static int ar_Hello_cbMultiByte = 24; static BYTE ar_HowAreYou_UTF8[] = "\xD9\x83\xD9\x8A\xD9\x81\x20\xD8\xAD\xD8\xA7\xD9\x84\xD9\x83\xD8" "\x9F\x00"; -static BYTE ar_HowAreYou_UTF16[] = "\x43\x06\x4A\x06\x41\x06\x20\x00\x2D\x06\x27\x06\x44\x06\x43\x06" +static _Alignas(WCHAR) BYTE ar_HowAreYou_UTF16[] = "\x43\x06\x4A\x06\x41\x06\x20\x00\x2D\x06\x27\x06\x44\x06\x43\x06" "\x1F\x06\x00\x00"; static int ar_HowAreYou_cchWideChar = 10; static int ar_HowAreYou_cbMultiByte = 18; @@ -81,12 +82,12 @@ static int ar_HowAreYou_cbMultiByte = 18 /* Chinese */ static BYTE ch_Hello_UTF8[] = "\xE4\xBD\xA0\xE5\xA5\xBD\x00"; -static BYTE ch_Hello_UTF16[] = "\x60\x4F\x7D\x59\x00\x00"; +static _Alignas(WCHAR) BYTE ch_Hello_UTF16[] = "\x60\x4F\x7D\x59\x00\x00"; static int ch_Hello_cchWideChar = 3; static int ch_Hello_cbMultiByte = 7; static BYTE ch_HowAreYou_UTF8[] = "\xE4\xBD\xA0\xE5\xA5\xBD\xE5\x90\x97\x00"; -static BYTE ch_HowAreYou_UTF16[] = "\x60\x4F\x7D\x59\x17\x54\x00\x00"; +static _Alignas(WCHAR) BYTE ch_HowAreYou_UTF16[] = "\x60\x4F\x7D\x59\x17\x54\x00\x00"; static int ch_HowAreYou_cchWideChar = 4; static int ch_HowAreYou_cbMultiByte = 10;