Re: [Mingw-w64-public] Problems when building NT kernel drivers with GCC / LD

2022-11-04 Thread Pali Rohár
On Saturday 05 November 2022 01:57:49 Pali Rohár wrote: > On Monday 31 October 2022 10:55:59 Jan Beulich wrote: > > On 30.10.2022 02:06, Pali Rohár via Binutils wrote: > > > * GCC or LD (not sure who) sets memory alignment characteristics > > > (IMAGE_SCN_ALIGN_MASK) into the sections of PE

Re: [Mingw-w64-public] Problems when building NT kernel drivers with GCC / LD

2022-11-04 Thread Pali Rohár
On Monday 31 October 2022 10:55:59 Jan Beulich wrote: > On 30.10.2022 02:06, Pali Rohár via Binutils wrote: > > * GCC or LD (not sure who) sets memory alignment characteristics > > (IMAGE_SCN_ALIGN_MASK) into the sections of PE executable binary. > > These characteristics should be only in

Re: [Mingw-w64-public] [PATCH] headers: Clarify a few aspects relating to Clang wrt the fortification macros

2022-11-04 Thread LIU Hao
在 2022/11/4 16:27, Martin Storsjö 写道: There's no problem in using the "artificial" attribute with Clang, at least as of Clang 10.0. Clarify why Clang is excluded for __MINGW_FORTIFY_VA_ARG. --- mingw-w64-headers/crt/_mingw_mac.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)

[Mingw-w64-public] [PATCH] headers: Clarify a few aspects relating to Clang wrt the fortification macros

2022-11-04 Thread Martin Storsjö
There's no problem in using the "artificial" attribute with Clang, at least as of Clang 10.0. Clarify why Clang is excluded for __MINGW_FORTIFY_VA_ARG. --- mingw-w64-headers/crt/_mingw_mac.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git

[Mingw-w64-public] [PATCH 2/3] crt: Stop using K function definitions in {str, wcs}to{u, i}max

2022-11-04 Thread Martin Storsjö
This silences warnings like these from Clang: ../misc/strtoimax.c:34:1: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype] strtoimax(nptr, endptr, base) Signed-off-by: Martin Storsjö ---

[Mingw-w64-public] [PATCH 1/3] crt: Make the prototype of tdestroy visible when compiling the implementation

2022-11-04 Thread Martin Storsjö
This silences a warning with Clang: ../misc/tdestroy.c:14:6: warning: no previous prototype for function 'tdestroy' [-Wmissing-prototypes] void tdestroy(void *root, void (*free_node)(void *)) ^ Signed-off-by: Martin Storsjö --- mingw-w64-crt/misc/tdestroy.c | 1 + 1 file changed, 1

[Mingw-w64-public] [PATCH 3/3] crt: Make single-bit bitfield variables unsigned

2022-11-04 Thread Martin Storsjö
This silences warnings when built with Clang: ../stdio/mingw_vfscanf.c:158:17: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion] s->seen_eof = 1; ^ ~ Signed-off-by: Martin Storsjö ---

Re: [Mingw-w64-public] [PATCH] headers/stdio: Don't attempt to perform buffer overflow checks when inlining is impossible

2022-11-04 Thread LIU Hao
在 2022/11/4 15:47, Martin Storsjö 写道: Yes, this looks good to me - thanks! I've had this combination included in my nightly test builds for the last few days and haven't run into any issues with it. Thanks, pushed to master now. -- Best regards, LIU Hao OpenPGP_signature Description:

Re: [Mingw-w64-public] [PATCH] headers/stdio: Don't attempt to perform buffer overflow checks when inlining is impossible

2022-11-04 Thread Martin Storsjö
On Fri, 4 Nov 2022, LIU Hao wrote: 在 2022/11/4 14:42, Martin Storsjö 写道: But I think this still is kinda safe. After my revert-patch, Clang shouldn't see any of the functions with __asm__ renames at all. GCC needs these renamings, to allow using gnu_inline, to fix issues with

Re: [Mingw-w64-public] [PATCH] headers/stdio: Don't attempt to perform buffer overflow checks when inlining is impossible

2022-11-04 Thread LIU Hao
在 2022/11/4 14:42, Martin Storsjö 写道: But I think this still is kinda safe. After my revert-patch, Clang shouldn't see any of the functions with __asm__ renames at all. GCC needs these renamings, to allow using gnu_inline, to fix issues with __builtin_va_arg_pack(). Strictly speaking, only

Re: [Mingw-w64-public] [PATCH] headers/stdio: Don't attempt to perform buffer overflow checks when inlining is impossible

2022-11-04 Thread Martin Storsjö
On Fri, 4 Nov 2022, LIU Hao wrote: 在 2022/11/1 18:18, Martin Storsjö 写道: Attached is a patch that goes on top of this, which reverts the parts which should be strictly unnecessary (and currently are breaking Clang on i386). I suddenly realized that this could result in infinite loops

Re: [Mingw-w64-public] [PATCH] headers/stdio: Don't attempt to perform buffer overflow checks when inlining is impossible

2022-11-04 Thread LIU Hao
在 2022/11/1 18:18, Martin Storsjö 写道: Attached is a patch that goes on top of this, which reverts the parts which should be strictly unnecessary (and currently are breaking Clang on i386). I suddenly realized that this could result in infinite loops with Clang, so not sure we should