- The "IRQ" debugger option was introduced in commit 5a6adb4f13 (r2546).
It was used by the in-kernel GDB stub, to manually wire an interrupt
handler `GspBreakIn()` to allow the debugger to break into the system
when a command is received on the GDB serial port.
Side-remark:
The hooking was done via `HalGetInterruptVector()` + `IoConnectInterrupt()`,
but only at phase 1 initialization when the memory manager was up, which
can be "late" enough during system boot initialization.
Instead of using `IoConnectInterrupt()`, one could have used explicit
`KeInitializeInterrupt()` + `KeConnectInterrupt()` calls that would
have worked much earlier in the boot stage.
- This functionality was soon after disabled in commit c804ca06be (r2946)
in the GDB stub (see `ntoskrnl/kd/gdbstub.c!KdGdbStubInit()`), never
to be re-enabled again.
It was removed completely in commit e160c0fb26 (r14799).
- Since ReactOS was (until recently) always debugged locally using the
in-kernel KDBG debugger, break-in was done with TAB-K keypress,
intercepted by the keyboard driver that triggered a `DbgBreakPoint()`,
thus no break-in via serial port interrupt was necessary.
- Remote debugger break-in detection, which is the standard method that
is used when remote-debugging using KD transport DLLs and WinDbg, was
introduced in commit 12e7593f24 (r25984). As with the rest of debugger
communication and as done on Windows, detection is done by polling the
serial port at certain times, namely in the `KeUpdateSystemTime()`
kernel procedure periodically invoked by the timer interrupt.
This break-in detection was then erroneously removed in commit bf8b9467dc
(r45140), and reinstated in commit 014b23b9a (r56194).
- Parsing of this "IRQ" option was copy-pasted in other modules (FreeLoader,
KDCOM, and KDGDB), even though it was never used. The parsing was then
removed in KDBG itself in commit 95faf65ebf, but left in the other
modules... until now!
- Use DEFAULT_DEBUG_BAUD_RATE for the debug serial port.
- Use a less dramatic "Serial port not available" (without '!')
instead of "Serial port not found!" message, in case ReactOS
BSODs without a debugger attached to a serial port.
Sometimes people mistake this informational line as one of the
reasons why ReactOS BSODed or whatnot...
- Replace "Serial port found" by "Using COM..." message.
Cherry-picking commit
3158b917a2
See https://github.com/bobranten/Ext4Fsd/issues/83 for more information,
and debug traces.
## How to reproduce:
- Format a partition in Ext2 with Paragon Hard Disk Manager 2010 Professional.
- Compile ReactOS with MSVC, ensuring that the driver is compiled with
`EXT2_HTREE_INDEX` defined and set to 1, and with Run-time error checks
enabled with the `/RTC1` flag (this is the default in our source tree).
- Install ReactOS on this partition.
## What's being observed:
After reboot, some filesystem paths are accessed, and the code inside the
`#ifdef EXT2_HTREE_INDEX` block is taken (in ext2/src/dirctl.c#L777-L794).
For some reasons, the retrieved `rc` doesn't get the "expected" value and
the `goto errorout;` path is taken. After this label, `FileIndex` was
reset to `ByteOffset`, which remained uninitialized.
A bugcheck ensues because of the failed check (usage of uninitialized variable).
CORE-11954, CORE-16216, CORE-17518, CORE-17604, CORE-17977
The mkisofs options are quite long and repetitive (mostly duplicated 4 times
for the current 4 different ISO targets), and are also hard to read (i.e.
which group of options go together).
Reorganize the mkisofs ISO boot-related options in different thematic sets
and make them modular too. This also allow to conditionally add/remove ISO
boot entries for different platforms, for example:
- BIOS-based PC builds (only x86/x64) get the BIOS bootsector (excluded from IA64 and ARM32/64);
- EFI-based architectures get the EFI boot entry.
Based on a suggestion by Mark Jansen (see PR #4407).
Dedicated to Justin Miller ;)
_variant_t inherits from tagVARIANT aka VARIANT and C++ will always prioritize the built-in conversion to the base class over the use of a user-defined conversion operator.
Fixes GCC 13 warning:
In file included from C:/ReactOS/reactos/sdk/include/vcruntime/comdef.h:19,
from C:/ReactOS/reactos/sdk/lib/comsupp/comsupp.cpp:16:
C:/ReactOS/reactos/sdk/include/vcruntime/comutil.h:423:3: error: converting '_variant_t' to a base class 'VARIANT' {aka 'tagVARIANT'} will never use a type conversion operator [-Werror=class-conversion]
423 | operator VARIANT() const throw();
| ^~~~~~~~
Someone familiar with this should do a more proper fix.
C:/ReactOS/reactos/sdk/lib/atl/atlcom.h: In instantiation of 'class ATL::CComObject<CRShellClassFactory>':
C:/ReactOS/reactos/sdk/include/reactos/shellutils.h:357:45: required from 'HRESULT ShellObjectCreatorInit(T1, const IID&, void**) [with T = CRShellClassFactory; T1 = _GUID; HRESULT = long int; IID = _GUID]'
C:/ReactOS/reactos/base/shell/rshell/misc.cpp:256:55: required from here
C:/ReactOS/reactos/base/shell/rshell/misc.cpp:210:28: error: 'virtual HRESULT CRShellClassFactory::CreateInstance(LPUNKNOWN, const IID&, void**)' was hidden [-Werror=overloaded-virtual=]
210 | virtual HRESULT WINAPI CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject)
| ^~~~~~~~~~~~~~
In file included from C:/ReactOS/reactos/base/shell/rshell/misc.cpp:33:
C:/ReactOS/reactos/sdk/lib/atl/atlcom.h:171:27: note: by 'static HRESULT ATL::CComObject<Base>::CreateInstance(ATL::CComObject<Base>**) [with Base = CRShellClassFactory; HRESULT = long int]'
171 | static HRESULT WINAPI CreateInstance(CComObject<Base> **pp)
| ^~~~~~~~~~~~~~
C:/ReactOS/reactos/drivers/storage/ide/uniata/id_init.cpp: In function 'BOOLEAN UniataChipDetectChannels(PVOID, PPCI_COMMON_CONFIG, ULONG, PPORT_CONFIGURATION_INFORMATION)':
C:/ReactOS/reactos/drivers/storage/ide/uniata/id_init.cpp:111:5: error: this 'for' clause does not guard... [-Werror=misleading-indentation]
111 | for(i=deviceExtension->AHCI_PI_mask, n=0; i; n++, i=i>>1);
| ^~~
In file included from C:/ReactOS/reactos/drivers/storage/ide/uniata/stdafx.h:13,
from C:/ReactOS/reactos/drivers/storage/ide/uniata/id_init.cpp:48:
C:/ReactOS/reactos/drivers/storage/ide/uniata/atapi.h:154:24: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
154 | #define KdPrint2(_x_) {;}
| ^
C:/ReactOS/reactos/drivers/storage/ide/uniata/id_init.cpp:112:5: note: in expansion of macro 'KdPrint2'
112 | KdPrint2((PRINT_PREFIX "mask -> %d chans\n", n));
| ^~~~~~~~
C:/ReactOS/reactos/dll/win32/oleaut32/vartype.c: In function '_VarI1FromUI1':
C:/ReactOS/reactos/dll/win32/oleaut32/vartype.c:159:3: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
159 | if (in > (dest)tst) return DISP_E_OVERFLOW; *out = in; return S_OK; }
| ^~
C:/ReactOS/reactos/dll/win32/oleaut32/vartype.c:166:1: note: in expansion of macro 'POSTST'
166 | POSTST(signed char, BYTE, VarI1FromUI1, I1_MAX)
| ^~~~~~
C:/ReactOS/reactos/dll/win32/oleaut32/vartype.c:159:47: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
159 | if (in > (dest)tst) return DISP_E_OVERFLOW; *out = in; return S_OK; }
| ^
C:/ReactOS/reactos/dll/win32/oleaut32/vartype.c:166:1: note: in expansion of macro 'POSTST'
166 | POSTST(signed char, BYTE, VarI1FromUI1, I1_MAX)
| ^~~~~~
Fixes GCC 13 warning about misleading indentation.
C:/ReactOS/reactos/drivers/bus/acpi/busmgr/utils.c: In function 'acpi_evaluate_reference':
C:/ReactOS/reactos/drivers/bus/acpi/busmgr/utils.c:367:5: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
367 | if (buffer.Pointer)
| ^~
In file included from C:/ReactOS/reactos/drivers/bus/acpi/acpica/include/acpi.h:70,
from C:/ReactOS/reactos/drivers/bus/acpi/precomp.h:6,
from C:/ReactOS/reactos/drivers/bus/acpi/busmgr/utils.c:26:
C:/ReactOS/reactos/drivers/bus/acpi/acpica/include/acoutput.h:496:41: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
496 | #define return_ACPI_STATUS(s) return(s)
| ^~~~~~
C:/ReactOS/reactos/drivers/bus/acpi/busmgr/utils.c:370:9: note: in expansion of macro 'return_ACPI_STATUS'
370 | return_ACPI_STATUS(status);
| ^~~~~~~~~~~~~~~~~~
Fixes GCC 13 warning about misleading indentation.
C:/ReactOS/reactos/modules/rostests/winetests/advapi32/cred.c: In function 'func_cred':
C:/ReactOS/reactos/modules/rostests/winetests/advapi32/cred.c:809:5: error: this 'else' clause does not guard... [-Werror=misleading-indentation]
809 | else
| ^~~~
In file included from C:/ReactOS/reactos/modules/rostests/winetests/advapi32/cred.c:28:
C:/ReactOS/reactos/sdk/include/wine/test.h:168:31: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'else'
168 | #define trace_(file, line) (winetest_set_location(file, line), 0) ? (void)0 : winetest_trace
| ^
C:/ReactOS/reactos/sdk/include/wine/test.h:176:18: note: in expansion of macro 'trace_'
176 | #define trace trace_(__FILE__, __LINE__)
| ^~~~~~
C:/ReactOS/reactos/modules/rostests/winetests/advapi32/cred.c:812:9: note: in expansion of macro 'trace'
812 | trace("domain password:\n");
| ^~~~~
Fixes GCC 13 warnings about misleading indentation.
C:/ReactOS/reactos/dll/win32/shell32/wine/classes.c: In function 'HCR_GetIconA':
C:/ReactOS/reactos/dll/win32/shell32/wine/classes.c:357:5: error: this 'else' clause does not guard... [-Werror=misleading-indentation]
357 | else
| ^~~~
C:/ReactOS/reactos/dll/win32/shell32/wine/classes.c:360:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'else'
360 | return ret;
| ^~~~~~
C:/ReactOS/reactos/dll/win32/shell32/wine/shellord.c: In function 'SHCreateStdEnumFmtEtc':
C:/ReactOS/reactos/dll/win32/shell32/wine/shellord.c:2455:5: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
2455 | if (FAILED(hRes))
| ^~
In file included from C:/ReactOS/reactos/sdk/include/psdk/objbase.h:252,
from C:/ReactOS/reactos/sdk/include/psdk/ole2.h:25,
from C:/ReactOS/reactos/sdk/include/psdk/shlobj.h:22,
from C:/ReactOS/reactos/dll/win32/shell32/wine/shellord.c:32:
C:/ReactOS/build-gcc-x86/sdk/include/psdk/objidl.h:9734:37: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
9734 | #define IEnumFORMATETC_AddRef(This) (This)->lpVtbl->AddRef(This)
| ^
C:/ReactOS/reactos/dll/win32/shell32/wine/shellord.c:2458:9: note: in expansion of macro 'IEnumFORMATETC_AddRef'
2458 | IEnumFORMATETC_AddRef(pef);
| ^~~~~~~~~~~~~~~~~~~~~
Triggered by GCC 13:
C:/ReactOS/reactos/dll/3rdparty/libtiff/tif_luv.c:822:18: error: argument 1 of type 'float[3]' with mismatched bound [-Werror=array-parameter=]
822 | XYZtoRGB24(float xyz[3], uint8 rgb[3])
| ~~~~~~^~~~~~
In file included from C:/ReactOS/reactos/sdk/include/reactos/libs/libtiff/tiffiop.h:64,
from C:/ReactOS/reactos/dll/3rdparty/libtiff/precomp.h:3,
from C:/ReactOS/reactos/dll/3rdparty/libtiff/tif_luv.c:25:
C:/ReactOS/reactos/sdk/include/reactos/libs/libtiff/tiffio.h:507:24: note: previously declared as 'float *'
507 | extern void XYZtoRGB24(float*, uint8*);
| ^~~~~~
C:/ReactOS/reactos/modules/rostests/winetests/d3dx9_36/mesh.c: In function 'test_update_semantics':
C:/ReactOS/reactos/modules/rostests/winetests/d3dx9_36/mesh.c:4837:34: error: expression does not compute the number of elements in this array; element type is 'D3DVERTEXELEMENT9' {aka 'struct _D3DVERTEXELEMENT9'}, not 'int' [-Werror=sizeof-array-div]
4837 | for (i = sizeof(declaration0)/sizeof(*decl_mem); i < sizeof(declaration)/sizeof(*decl_mem); i++)
| ^
C:/ReactOS/reactos/modules/rostests/winetests/d3dx9_36/mesh.c:4837:42: note: add parentheses around '*decl_mem' to silence this warning
4837 | for (i = sizeof(declaration0)/sizeof(*decl_mem); i < sizeof(declaration)/sizeof(*decl_mem); i++)
| ~^~~~~~~~~~
| ( )
C:/ReactOS/reactos/modules/rostests/winetests/d3dx9_36/mesh.c:4667:23: note: array 'declaration0' declared here
4667 | D3DVERTEXELEMENT9 declaration0[] =
| ^~~~~~~~~~~~
C:/ReactOS/reactos/dll/directx/wine/ddraw/device.c: In function 'd3d_device3_ComputeSphereVisibility':
C:/ReactOS/reactos/dll/directx/wine/ddraw/device.c:4637:5: error: 'compute_sphere_visibility' accessing 192 bytes in a region of size 96 [-Werror=stringop-overflow=]
4637 | compute_sphere_visibility(plane, enabled_planes, TRUE, centers, radii, sphere_count, return_values);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/ReactOS/reactos/dll/directx/wine/ddraw/device.c:4637:5: note: referencing argument 1 of type 'struct wined3d_vec4[12]'
C:/ReactOS/reactos/dll/directx/wine/ddraw/device.c:4589:13: note: in a call to function 'compute_sphere_visibility'
4589 | static void compute_sphere_visibility(struct wined3d_vec4 plane[12], DWORD enabled_planes, BOOL equality,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
C:/ReactOS/reactos/drivers/filesystems/ext2/src/ext4/ext4_extents.c: In function 'ext4_ext_insert_index':
C:/ReactOS/reactos/drivers/filesystems/ext2/src/ext4/ext4_extents.c:788:22: warning: taking address of packed member of 'struct ext4_extent_header' may result in an unaligned pointer value [-Waddress-of-packed-member]
788 | le16_add_cpu(&curp->p_hdr->eh_entries, 1);
| ^~~~~~~~~~~~~~~~~~~~~~~~
The structure is packed in the original dosfstools code, too.
Fixes GCC 13 warning:
C:/ReactOS/reactos/sdk/lib/fslib/vfatlib/check/lfn.c: In function 'lfn_add_slot':
C:/ReactOS/reactos/sdk/lib/fslib/vfatlib/check/lfn.c:208:5: warning: converting a packed 'DIR_ENT' pointer (alignment 1) to a 'LFN_ENT' pointer (alignment 2) may result in an unaligned pointer value [-Waddress-of-packed-member]
208 | LFN_ENT *lfn = (LFN_ENT *) de;
| ^~~~~~~
In file included from C:/ReactOS/reactos/sdk/lib/fslib/vfatlib/check/dosfsck.h:8,
from C:/ReactOS/reactos/sdk/lib/fslib/vfatlib/vfatlib.h:25,
from C:/ReactOS/reactos/sdk/lib/fslib/vfatlib/check/lfn.c:24:
C:/ReactOS/reactos/sdk/lib/fslib/vfatlib/check/fsck.fat.h:165:9: note: defined here
165 | typedef struct {
| ^~~~~~
C:/ReactOS/reactos/sdk/lib/fslib/vfatlib/check/lfn.c:29:9: note: defined here
29 | typedef struct {
| ^~~~~~
While our glob is a dummy anyway and always returns NULL, the basic idea is that glob returns a NULL terminated array of pointers. The original code only calls blkfree to free any allocation in the array after the first one and doesn't free the array itself. Our code tried to be "smart" and free the array as well, but the array pointer was already changed by a "globbed++", resulting in trying to free an invalid address. Also the free was only called, when glob returned more than one result. This is now fixed by removing the "++", doing the blkfree on "&globbed[1]" and calling free on the originally returned array in all cases.
Fixes GCC 13 warning:
C:/ReactOS/reactos/base/applications/network/ftp/cmds.c: In function 'globulize':
C:/ReactOS/reactos/base/applications/network/ftp/cmds.c:1684:25: error: 'free' called on pointer 'globbed' with nonzero offset 4 [-Werror=free-nonheap-object]
1684 | free((char *)globbed);
| ^~~~~~~~~~~~~~~~~~~~~
C:/ReactOS/reactos/base/applications/network/ftp/cmds.c:1669:19: note: returned from 'glob'
1669 | globbed = glob(*cpp);
| ^~~~~~~~~~
In our port glob is a dummy that always returns NULL, and the original code does not have a free here, either.
This is some ATL weirdness. Someone familiar with this should do a more proper fix.
C:/ReactOS/reactos/sdk/lib/atl/atlcom.h: In instantiation of 'class ATL::CComObject<IDefClFImpl>':
C:/ReactOS/reactos/sdk/include/reactos/shellutils.h:401:45: required from 'HRESULT ShellObjectCreatorInit(T1, T2, T3, const IID&, void**) [with T = IDefClFImpl; T1 = long int (__attribute__((stdcall)) *)(IUnknown*, const _GUID&, void**); T2 = long int*; T3 = const _GUID*; HRESULT = long int; IID = _GUID]'
C:/ReactOS/reactos/dll/win32/shell32/shell32.cpp:202:47: required from here
C:/ReactOS/reactos/dll/win32/shell32/shell32.cpp:172:16: error: 'virtual HRESULT IDefClFImpl::CreateInstance(IUnknown*, const IID&, void**)' was hidden [-Werror=overloaded-virtual=]
172 | HRESULT WINAPI IDefClFImpl::CreateInstance(IUnknown * pUnkOuter, REFIID riid, LPVOID *ppvObject)
| ^~~~~~~~~~~
In file included from C:/ReactOS/reactos/dll/win32/shell32/precomp.h:32,
from C:/ReactOS/reactos/dll/win32/shell32/shell32.cpp:22:
C:/ReactOS/reactos/sdk/lib/atl/atlcom.h:171:27: note: by 'static HRESULT ATL::CComObject<Base>::CreateInstance(ATL::CComObject<Base>**) [with Base = IDefClFImpl; HRESULT = long int]'
171 | static HRESULT WINAPI CreateInstance(CComObject<Base> **pp)
| ^~~~~~~~~~~~~~
Fixes GCC 13 warning:
C:/ReactOS/reactos/modules/rostests/rosautotest/tools.cpp: In function 'std::wstring AsciiToUnicode(const char*)':
C:/ReactOS/reactos/modules/rostests/rosautotest/tools.cpp:231:12: error: 'void operator delete(void*)' called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete]
231 | delete UnicodeString;
| ^~~~~~~~~~~~~
Fixes GCC 13 warning:
C:/ReactOS/reactos/dll/cpl/mmsys/sounds.c: In function 'ShowSoundScheme':
C:/ReactOS/reactos/dll/cpl/mmsys/sounds.c:995:17: error: the comparison will always evaluate as 'true' for the address of 'szValue' will never be NULL [-Werror=address]
995 | if (pLabelContext->szValue && wcslen(pLabelContext->szValue) > 0)
| ^~~~~~~~~~~~~
C:/ReactOS/reactos/dll/cpl/mmsys/sounds.c:44:11: note: 'szValue' declared here
44 | WCHAR szValue[MAX_PATH];
| ^~~~~~~
C:/ReactOS/reactos/base/shell/cmd/del.c: In function 'ProcessDirectory':
C:/ReactOS/reactos/base/shell/cmd/del.c:333:17: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
333 | if (!(f.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ||
| ^~
In file included from C:/ReactOS/reactos/base/shell/cmd/precomp.h:14,
from C:/ReactOS/reactos/base/shell/cmd/del.c:48:
C:/ReactOS/reactos/sdk/include/crt/tchar.h:246:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
246 | #define _tcscpy wcscpy
| ^~~~~~
C:/ReactOS/reactos/base/shell/cmd/del.c:338:21: note: in expansion of macro '_tcscpy'
338 | _tcscpy(pFilePart, f.cFileName);
| ^~~~~~~
GCC 13 doesn't like if you keep a dangling pointer around.
C:/ReactOS/reactos/base/shell/cmd/for.c: In function 'ForF':
C:/ReactOS/reactos/base/shell/cmd/for.c:307:20: error: storing the address of local variable 'Variables' in '*fc.values' [-Werror=dangling-pointer=]
307 | fc->values = Variables;
| ~~~~~~~~~~~^~~~~~~~~~~
C:/ReactOS/reactos/base/shell/cmd/for.c:141:12: note: 'Variables' declared here
141 | LPTSTR Variables[32];
| ^~~~~~~~~
C:/ReactOS/reactos/base/shell/cmd/for.c:57:14: note: 'fc' declared here
57 | PFOR_CONTEXT fc = NULL;
| ^~
Make the code simpler, so GCC doesn't get confused.
C:/ReactOS/reactos/base/shell/cmd/misc.c: In function 'add_entry':
C:/ReactOS/reactos/base/shell/cmd/misc.c:216:14: error: pointer 'oldarg' may be used after 'realloc' [-Werror=use-after-free]
216 | *arg = oldarg;
| ~~~~~^~~~~~~~
In file included from C:/ReactOS/reactos/base/shell/cmd/cmd.h:29,
from C:/ReactOS/reactos/base/shell/cmd/precomp.h:34,
from C:/ReactOS/reactos/base/shell/cmd/misc.c:35:
C:/ReactOS/reactos/base/shell/cmd/cmddbg.h:30:31: note: call to 'realloc' here
30 | #define cmd_realloc(ptr,size) realloc(ptr, size)
| ^~~~~~~~~~~~~~~~~~
C:/ReactOS/reactos/base/shell/cmd/misc.c:212:12: note: in expansion of macro 'cmd_realloc'
212 | *arg = cmd_realloc (oldarg, (*ac + 2) * sizeof (LPTSTR));
| ^~~~~~~~~~~
Don't strncpy 0 bytes. Also add an assert that source and dest are not the same.
C:/ReactOS/reactos/base/applications/network/nslookup/utility.c: In function 'ReverseIP':
C:/ReactOS/reactos/base/applications/network/nslookup/utility.c:264:5: error: 'strncpy' destination unchanged after copying no bytes [-Werror=stringop-truncation]
264 | strncpy( &pReturn[k], &pIP[i + 1], (j - i) );
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Instead give IMAGE_PART a complete default contructor. Fixes GCC 13 warning.
In file included from C:/ReactOS/reactos/sdk/include/psdk/minwindef.h:171,
from C:/ReactOS/reactos/sdk/include/psdk/windef.h:17,
from C:/ReactOS/reactos/base/applications/mspaint/precomp.h:17,
from C:/ReactOS/reactos/base/applications/mspaint/history.cpp:9:
C:/ReactOS/reactos/base/applications/mspaint/history.cpp: In constructor 'ImageModel::ImageModel()':
C:/ReactOS/build-gcc-x86/sdk/include/psdk/winnt.h:8732:47: error: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'struct IMAGE_PART'; use assignment or value-initialization instead [-Werror=class-memaccess]
8732 | #define RtlFillMemory(Dest,Length,Fill) memset((Dest),(Fill),(Length))
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
C:/ReactOS/build-gcc-x86/sdk/include/psdk/winnt.h:8733:36: note: in expansion of macro 'RtlFillMemory'
8733 | #define RtlZeroMemory(Dest,Length) RtlFillMemory((Dest),(Length),0)
| ^~~~~~~~~~~~~
C:/ReactOS/reactos/sdk/include/psdk/minwinbase.h:31:20: note: in expansion of macro 'RtlZeroMemory'
31 | #define ZeroMemory RtlZeroMemory
| ^~~~~~~~~~~~~
C:/ReactOS/reactos/base/applications/mspaint/history.cpp:41:5: note: in expansion of macro 'ZeroMemory'
41 | ZeroMemory(m_historyItems, sizeof(m_historyItems));
| ^~~~~~~~~~
GCC 13 thinks that a global 'const PULONG' that is initialized to a non-NULL value points to an object that is "likely at address zero".
- Turn the macros that cause the issue into inline functions and wrap them with a GCC diagnostic pragma to silence the warning
- Use KiNtVdmState in vdm/vdmexec.c
- Remove the (duplicated) VdmState macro
In function '_InterlockedAnd',
inlined from 'KiVdmOpcodePOPF' at C:/ReactOS/reactos/ntoskrnl/ke/i386/v86vdm.c:164:5:
C:/ReactOS/reactos/sdk/include/vcruntime/mingw32/intrin_x86.h:245:16: error: '__sync_fetch_and_and_4' writing 4 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
245 | return __sync_fetch_and_and(value, mask);
| ^~~~~~~~~~~~~~~~~~~~
In function 'KiVdmOpcodePOPF':
cc1.exe: note: destination object is likely at address zero
Also apply _SEH2_VOLATILE where needed (all variables that are set in the __try block and referenced in the __except or __finally block).
It's hard to tell whether these are false positives, because the code is quite a mess.
C:/ReactOS/reactos/drivers/filesystems/udfs/udfinit.cpp: In function 'NTSTATUS UDFDismountDevice(PUNICODE_STRING)':
C:/ReactOS/reactos/drivers/filesystems/udfs/udfinit.cpp:643:36: error: 'Buffer' is used uninitialized [-Werror=uninitialized]
643 | PFILE_FS_ATTRIBUTE_INFORMATION Buffer;
| ^~~~~~
Suppress warning about infinite recursion, because that is the whole point of this test.
C:/ReactOS/reactos/modules/rostests/apitests/ntdll/StackOverflow.c: In function 'infinite_recursive':
C:/ReactOS/reactos/modules/rostests/apitests/ntdll/StackOverflow.c:23:1: error: infinite recursion detected [-Werror=infinite-recursion]
23 | infinite_recursive(void)
| ^~~~~~~~~~~~~~~~~~
C:/ReactOS/reactos/modules/rostests/apitests/ntdll/StackOverflow.c:58:5: note: recursive call
58 | infinite_recursive();
| ^~~~~~~~~~~~~~~~~~~~
Fixes GCC 13 warning:
C:/ReactOS/reactos/modules/rostests/apitests/crt/crtdata.c: In function 'Test___badioinfo':
C:/ReactOS/reactos/modules/rostests/apitests/crt/crtdata.c:75:20: error: the comparison will always evaluate as 'true' for the address of '__badioinfo' will never be NULL [-Werror=address]
75 | ok(__badioinfo != NULL, "__badioinfo is NULL\n");
| ^~
C:/ReactOS/reactos/modules/rostests/apitests/crt/crtdata.c:74:28: note: '__badioinfo' declared here
74 | _CRTIMP extern ioinfo* __badioinfo[];
| ^~~~~~~~~~~
Fixes GCC 13 warning:
C:/ReactOS/reactos/modules/rostests/apitests/iphlpapi/GetNetworkParams.c: In function 'test_GetNetworkParams':
C:/ReactOS/reactos/modules/rostests/apitests/iphlpapi/GetNetworkParams.c:171:28: error: the comparison will always evaluate as 'true' for the address of 'HostName' will never be NULL [-Werror=address]
171 | ok(FixedInfo->HostName != NULL, "FixedInfo->HostName is NULL\n");
| ^~
C:/ReactOS/reactos/base/services/dhcpcsvc/dhcp/adapter.c: In function 'AdapterDiscoveryThread':
C:/ReactOS/reactos/base/services/dhcpcsvc/dhcp/adapter.c:326:28: error: 'AdapterFindByHardwareAddress' accessing 16 bytes in a region of size 8 [-Werror=stringop-overflow=]
326 | if ((Adapter = AdapterFindByHardwareAddress(Table->table[i].bPhysAddr, Table->table[i].dwPhysAddrLen)))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/ReactOS/reactos/base/services/dhcpcsvc/dhcp/adapter.c:326:28: note: referencing argument 1 of type 'u_int8_t[16]' {aka 'unsigned char[16]'}
C:/ReactOS/reactos/base/services/dhcpcsvc/dhcp/adapter.c:544:15: note: in a call to function 'AdapterFindByHardwareAddress'
544 | PDHCP_ADAPTER AdapterFindByHardwareAddress( u_int8_t haddr[16], u_int8_t hlen ) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
pseh2_64 relied on inline-asm clobbers across a C/asm funclet jump, which is not a reliable ABI boundary.
On AMD64 gcc path, this can corrupt non-volatile state during exception filtering/unwind.
This change makes the trampoline ABI-safe by explicitly preserving and restoring non-volatile registers and keeping unwind metadata/prologue consistent.
Changes:
- Save/restore rbx, rdi, rsi, r12-r15 in `__seh2_global_filter_func`.
- Adjust stack allocation/unwind annotation to match the new prologue/epilogue.
- Keep filter return in eax and jump back through `__seh2_global_filter_func_exit`.
Note: This is exception-only path: extra stack usage is acceptable for correctness.
How to test: Build and run ReactOS with gcc 13/15; you should no longer see stack exhaustion.