freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: new compiler warnings in freetype 2.10.2 32-bit


From: David Turner
Subject: Re: new compiler warnings in freetype 2.10.2 32-bit
Date: Fri, 24 Jul 2020 13:30:32 +0200



Le ven. 24 juil. 2020 à 05:58, Vincent Torri <vincent.torri@gmail.com> a écrit :
hello

some comments:

strcasecmp does not exist when compiling with Visual Studio (_stricmp
does though and is doing the same job). mingw-w64 use a #define for
that.Why not adding ft_strcasecmp like ft_strdup ?

note that using strdup with Visual Studio and passing
_CRT_NONSTDC_NO_DEPRECATE removes the warning.

I think that in this case, it is actually simpler to re-implement the function rather than trying to fight the compiler and build system with the right set options :-)
Very fortunately, this is not part of a critical performance loop, otherwise, we would do things differently.
 
Vincent Torri

On Fri, Jul 24, 2020 at 5:02 AM David Turner <david@freetype.org> wrote:
>
> A better answer is to actually get rid of strcpy() / strcat() / sprintf() because there will always be compilers complaining about them.
>
> Here's a patch that does that for freetype2-demos, please take a look.
>
> Le jeu. 23 juil. 2020 à 13:16, Werner LEMBERG <wl@gnu.org> a écrit :
>>
>> > There seems to be a new warning in 2.10.2 (compared to 2.10.1) when
>> > compiling for 32-bit: [...]
>>
>> Fixed in git, thanks.
>>
>> > Also have had a bunch of strncat related warning (probably gcc 1 specific, or some compiler switch specific) in ft2-demos, for a while:
>> >
>> > ===
>> >     inlined from 'RunIns' at src/ttdebug.c:2105:11:
>> > /usr/include/bits/string_fortified.h:136:10: warning:
>> > '__builtin___strncat_chk' output may be truncated copying 31 bytes
>> > from a string of length 31 [-Wstringop-truncation]
>>
>> (The problematic calls of strncat are in function `Cur_U_Line'.)
>>
>> Hmm.  The answer to
>>
>>   https://stackoverflow.com/questions/50198319/gcc-8-wstringop-truncation-what-is-the-good-practice
>>
>> recommends to switch off the warning if the code does exactly ...
>>
>>
>>     Werner
>>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]