Liu Hao wrote:
在 2019/8/27 5:26, Christian Franke 写道:
I have a couple of questions:

0) What was the purpose of the suppression of `-Wformat-nonliteral`? It
     seemed not added in every `v?sn?printf` function.
The new inline sn?printf() functions delegate the call to (non-v)
*_sn?printf() functions. This is not the case in the existing code.
The pragmas are not really necessary as warnings are normally suppressed
for system includes. I added these because there are already 'ignored
"-Wshadow"' in this file.
Yeah I was asking that why those paradigms weren't added for
`v*printf()` functions, because the delegation exist there as well.

These warnings are not printed for calls of the v*printf() functions, only for the non-v variants. Delegating to non-v variants always requires __builtin_va_arg_pack() which is not used in the existing code.



2) Would you please add a wrapper for `memmove()` as well?
Of course, plus mempcpy(). New patch attached.

`mempcpy()` is a GNU extension so please wrap it in an `#ifdef
_GNU_SOURCE ... #endif` block.

The original mempcpy() and possibly other GNU extensions are also not guarded by _GNU_SOURCE in the current string.h. Should possibly be fixed first independently, then I'm happy to adjust the patch.


Also be advised that those `__builtin___*_chk()` things are only
available since GCC 4.9.

These are possibly available since 4.1:
https://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Object-Size-Checking.html
Actually there is not much difference (except section number) to current documentation:
https://gcc.gnu.org/onlinedocs/gcc/Object-Size-Checking.html

I revived a 2012 Debian wheezy from my VM-graveyard for a quick test:
It provides gcc 4.7.0 and *-w64-mingw32 4.6.3. Both support __buildin__*_chk() and a runtime with the required __*_chk() functions. The Linux glibc includes actually use these, the code is guarded with __GNU_PREREQ(4,1).


  Your very first hunk checks for GCC 4.3 which
is inconsistent.

The very first check is unrelated to __builtin___*_chk(). It checks for 4.3 because __builtin_va_arg_pack() is available since then:
https://gcc.gnu.org/onlinedocs/gcc-4.3.0/gcc/Constructing-Calls.html
https://gcc.gnu.org/onlinedocs/gcc-4.2.0/gcc/Constructing-Calls.html

The second check which sets __MINGW_FORTIFY_LEVEL could possibly be changed to 4.1 instead of 4.3, see above.


  For maximum compatibility I suggest you get rid of
those builtin things, declare those functions w/o the `__builtin_`
prefix at the beginning of the file, and rewrite calls to them.

IMO not needed, see above.


--
Regards,
Christian



_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to