Regarding <inttypes.h>: https://en.cppreference.com/w/cpp/types/integer

On Mon, May 25, 2020 at 11:58 PM Michal Sudolsky <[email protected]>
wrote:

>
>>         Hi,
>> this is long time ago. I checked the code above (at r2008) and it looks
>> like this:
>>
>>   int read = sscanf( m_buffer.GetBuffer(), "%10" PDF_FORMAT_INT64 " %5"
>> PDF_FORMAT_INT64 " %c%c%c",
>>                     &llOffset, &llGeneration, &cUsed, &empty1, &empty2 );
>>
>> which makes me think that PDF_FORMAT_INT64 is not properly set on OSX,
>> or the sscanf() cannot decipher it properly. Both feels unlikely, but I
>> do not have any environment to test it with.
>>
>>
> Why not use <inttypes.h>? There should be proper macros for
> printing/scanning int64_t.
>
> Here size of both long (SZ_LONG) and int64_t (SZ_INT64) is 8 so "ld" is
> used:
>
> #elif defined(SZ_INT64) && defined(SZ_LONG) && SZ_INT64 == SZ_LONG
> #  define PDF_FORMAT_INT64 "ld"
> #  define PDF_FORMAT_UINT64 "lu"
> #  define PDF_SIZE_FORMAT "zu"
>
> Also size of "long long" is 8. I suppose on linux are used these same
> defines.
>
> Probably only compiler on osx have problem with this which is clang
> instead of gcc on linux.
>
> On linux there is also this new strange warning (except usual deprecated
> declarations):
>
> podofo/base/PdfDate.cpp:205:50: warning: ā€˜%s’ directive output may be
> truncated writing up to 5 bytes into a region of size between 1 and 26
> [-Wformat-truncation=]
>   205 |     snprintf( m_szDate, PDF_DATE_BUFFER_SIZE, "%s%s'00'", szDate,
> szZone );
>
> If I am not wrong there are many other warnings under some circumstances
> (do not remember now exactly) like these:
> -Wunused-private-field
> -Wdeprecated-copy
> -Wdeprecated-declarations
> -Wignored-qualifiers
> -Wunused-parameter
> -Wstringop-truncation
>
> I can send more details about them.
>
> I do not see this one too. Do you build with LUA? The code in question
>> looks properly, from my point of view:
>>
>> #ifdef PODOFO_HAVE_LUA
>>     else if( converter == "lua" )
>>     {
>>         pConverter = new LuaConverter( lua );
>>     }
>> #else
>>     PODOFO_UNUSED_PARAM( lua )
>> #endif //  PODOFO_HAVE_LUA
>>
>> I do see unused parameter warnings from other functions, thus it is
>> enabled here.
>>
>
> No. Maybe this was already resolved or this happens under above mentioned
> "circumstances".
>
>         Bye,
>>         zyx
>>
>>
>>
>> _______________________________________________
>> Podofo-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/podofo-users
>>
>
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to