sal/cppunittester/cppunittester.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 631b3887ab417678cc993ef68c0fd7f86ac56c86
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Thu Sep 30 10:09:07 2021 +0200
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Thu Sep 30 14:50:31 2021 +0200

    -Werror,-Wformat (clang-cl)
    
    > sal/cppunittester/cppunittester.cxx(553,115): error: format specifies 
type 'unsigned int' but the argument has type 'ULONG64' (aka 'unsigned long 
long') [-Werror,-Wformat]
    >             printf("\tat %s in %s: line: %lu: address: 0x%0X\n", 
pSymbol->Name, line->FileName, line->LineNumber, pSymbol->Address);
    >                                                          ~~~              
                                        ^~~~~~~~~~~~~~~~
    >                                                          %0llX
    > sal/cppunittester/cppunittester.cxx(558,64): error: format specifies type 
'unsigned int' but the argument has type 'ULONG64' (aka 'unsigned long long') 
[-Werror,-Wformat]
    >             printf("\tat %s, address 0x%0X.\n", pSymbol->Name, 
pSymbol->Address);
    >                                        ~~~                     
^~~~~~~~~~~~~~~~
    >                                        %0llX
    > sal/cppunittester/cppunittester.cxx(576,50): error: format specifies type 
'unsigned int' but the argument has type 'DWORD' (aka 'unsigned long') 
[-Werror,-Wformat]
    >     printf("*** Exception 0x%x occurred 
***\n\n",ex->ExceptionRecord->ExceptionCode);
    >                             ~~                   
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    >                             %lx
    
    ...but where SYMBOL_INFO::Address is documented to be of type ULONG64, 
which in
    turn is documented to be a typedef for unsigned __int64, for which there
    is the MSVC-extension I64 format specifier
    
    Change-Id: Ibed1d3fa49ac6fd988174c6041071292fc66dd3d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122872
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/sal/cppunittester/cppunittester.cxx 
b/sal/cppunittester/cppunittester.cxx
index 1e1d5e65f59e..3ec11a3ffc3a 100644
--- a/sal/cppunittester/cppunittester.cxx
+++ b/sal/cppunittester/cppunittester.cxx
@@ -550,12 +550,12 @@ static void printStack( CONTEXT* ctx )
         //try to get line
         if (SymGetLineFromAddr64(process, stack.AddrPC.Offset, &disp, 
line.get()))
         {
-            printf("\tat %s in %s: line: %lu: address: 0x%0X\n", 
pSymbol->Name, line->FileName, line->LineNumber, pSymbol->Address);
+            printf("\tat %s in %s: line: %lu: address: 0x%0I64X\n", 
pSymbol->Name, line->FileName, line->LineNumber, pSymbol->Address);
         }
         else
         {
             //failed to get line
-            printf("\tat %s, address 0x%0X.\n", pSymbol->Name, 
pSymbol->Address);
+            printf("\tat %s, address 0x%0I64X.\n", pSymbol->Name, 
pSymbol->Address);
             hModule = NULL;
             lstrcpyA(module,"");
             GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | 
GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
@@ -573,7 +573,7 @@ static void printStack( CONTEXT* ctx )
 static LONG WINAPI ExpFilter(EXCEPTION_POINTERS* ex)
 {
     // we only want this active on the Jenkins tinderboxes
-    printf("*** Exception 0x%x occurred 
***\n\n",ex->ExceptionRecord->ExceptionCode);
+    printf("*** Exception 0x%lx occurred 
***\n\n",ex->ExceptionRecord->ExceptionCode);
     printStack(ex->ContextRecord);
     return EXCEPTION_EXECUTE_HANDLER;
 }

Reply via email to