Commit Graph

88469 Commits

Author SHA1 Message Date
Hermès Bélusca-Maïto
20e16781bb [KDCOM][KDGDB][KDVM] Adjust the file names reported in their version resources 2026-03-21 23:16:12 +01:00
Hermès Bélusca-Maïto
9669b3124f [KDGDB] Fix build with x86 and x64 MSVC (#5187)
```
gdb_input.c(243): error C4477: '_snprintf' : format string '%p' requires
  an argument of type 'void *', but variadic argument 1 has type 'UINT_PTR'

i386_sup.c(98): error C4090: 'return': different 'const' qualifiers
amd64_sup.c(115): error C4090: 'return': different 'const' qualifiers
```
2026-03-21 22:52:16 +01:00
Hermès Bélusca-Maïto
6e3e7f0d23 [KDGDB] Recognize both 'DEBUGPORT=GDB' and 'DEBUGPORT=COM' syntaxes (#5187) 2026-03-21 22:52:09 +01:00
Hermès Bélusca-Maïto
912c8ad987 [KDGDB] Don't make GDB a separate citizen (#5187)
But add KDGDB compilation only for x86 and x64, since for other
architectures (e.g. ARM) it currently emits the following error:
```
drivers/base/kdgdb/kdgdb.h(149): fatal error C1189: #error:
    "Please define relevant macros for your architecture"
```

For the time being, keep the "GDB" build configuration macro, used for
Gitpod testing... but this needs to be replaced with a more robust solution.
Because of this, rename kdgdb.dll to kdcom.dll, and kdcom.dll to kdser.dll
so that GDB is used by default, and we don't get a file name clash too.

Revert also commit 57cf5cdc5d.
2026-03-21 22:46:58 +01:00
Hermès Bélusca-Maïto
d012a8c4a3 [KDGDB] Minor formatting/typo fixes 2026-03-21 18:16:07 +01:00
Hermès Bélusca-Maïto
6c532e771e [FREELDR][KDCOM][KDGDB] Allow specifying the serial port address in the DEBUGPORT option
This is the same feature as the one that already exists in the
NTOS:KD!kdmain.c module used by the in-kernel KDBG debugger
(GCC builds), first introduced in commit 4ce30245de (r54473),
and documented at:
https://reactos.org/wiki/Debugging#Changing_the_serial_port_address

This feature is useful if one uses a PCI, PCIe, PCMCIA, or ExpressCard
serial card on real hardware (these cards are used e.g. with laptops
without a built-in serial port), or with AMT serial over LAN.
After determining the serial port I/O address (say, 0xCC00), specify
the debug port as follows:

/DEBUGPORT=COM:0xCC00

instead of the usual syntax: /DEBUGPORT=COMn (n an integer).

The same syntax can be used for debugging FreeLoader as well: in the
FREELDR.INI file, add a "Debug" line in the "FREELOADER" section,
as follows:

```
[FREELOADER]
Debug=/DEBUG /DEBUGPORT=COM:0xCC00 /BAUDRATE=115200
```

----

NOTE for KDCOM/KDGDB:

Since `strtoul()` is used, but isn't exported by ntoskrnl, link against
the "strtol" static library that has been introduced in commit d317d4fbcc
(r71481).
2026-03-21 00:10:21 +01:00
Hermès Bélusca-Maïto
f77fcc15ff [FREELDR:INI] Remove trailing whitespace from parsed INI key name
Leading whitespace was already skipped in the code.
2026-03-21 00:06:30 +01:00
Hermès Bélusca-Maïto
8e8cd2e1f6 [FREELDR:INI] inifile.h/parse.c: Formatting; use PCSTR where applicable 2026-03-21 00:06:28 +01:00
Hermès Bélusca-Maïto
acb91336e3 [NTOS:KD] Const-ify the KdpGetDebugMode() function parameter 2026-03-21 00:06:28 +01:00
Hermès Bélusca-Maïto
956d9f7973 [FREELDR][KDCOM][KDGDB][KDVM][NTOS:KD] Don't overrun the command-line when parsing "DEBUGPORT"
Don't loop past the end of the command-line buffer, if the command-line
terminates with a lone "DEBUGPORT" without any extra parameter following.
For example: "some things   DEBUGPORT  "
2026-03-21 00:06:20 +01:00
Timo Kreuzer
7cc4459d3c [SDK] wine/test.h: reduce diff to wine-10.0 (#8710)
* test.h: remove obsolete wine specific definitions - __winetest_cdecl, __winetest_va_* aren't used anymore
* Add missing winetest_ prefixes
* Rename winetest_get_thread_data
* Update global variables
* Move winetest_thread_data
* Make winetest_get_thread_data extern
* [ISAPNP_UNITTEST] Use static inline instead of FORCEINLINE (GCC complains when a non-static inine function calls a static inline function)
* Move winetest_win_skip and make it static
* Move winetest_start_todo and make it static inline
* Move winetest_start_todo and make it static inline
* Move winetest_get_failures and winetest_add_failures and make them static
* Add winetest_print_lock and winetest_print_unlock
* Add winetest_get_time and winetest_elapsed
* Add flaky support
* Add exc_filter and running_under_wine
* Move reactos specific things together
2026-03-20 20:02:12 +00:00
Ahmed Arif
1c2b5a1a8e [SEH][GCC] Prevent inlining of functions using REACTOS seh pragma 2026-03-20 14:57:40 +02:00
Ahmed ARIF
094d06eb26 [ASMPP] Fix .text exporting for MASM .code blocks 2026-03-20 13:50:03 +02:00
Hermès Bélusca-Maïto
b7c3432070 [NTOS:KD] Restore BAUDRATE option support
Support for the BAUDRATE option was erroneously removed in commit 95faf65ebf.
As a result, the in-kernel KDBG debugger was always running with the
default debug port baud rate (115200 Bd), even if the user tried to
override it with the BAUDRATE option for supporting terminals that use
a different baud rate.
2026-03-19 23:22:54 +01:00
Hermès Bélusca-Maïto
c4d60756dd [FREELDR][KDCOM][KDGDB][NTOS:KD] Some code "nits"
- Don't hardcode constant string lengths.

- Use `_strnicmp()` -- Ideally we shouldn't have to unconditionally upcase
  the global kernel command-line string to perform substrings comparisons.

- Cast `atol()` returned value to `ULONG`.
2026-03-19 22:49:29 +01:00
Hermès Bélusca-Maïto
4d0642b67f [FREELDR][KDCOM][KDGDB][NTOS:KD] Minor code comments enhancements 2026-03-19 22:14:00 +01:00
Hermès Bélusca-Maïto
bcd4c718c1 [HALX86] Use correct HalpComPortIrqMapping values in PC98
In addition, there is no COM port IRQ mapping on the Xbox,
so exclude this from the Xbox HAL build.
2026-03-19 21:53:12 +01:00
Hermès Bélusca-Maïto
b1a31610ac [FREELDR][KDCOM][KDGDB] Remove deprecated "IRQ" debugger command-line option
- 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!
2026-03-19 21:52:14 +01:00
Hermès Bélusca-Maïto
fe6ee1223a [NTOS:KDBG] Fix misleading indentation
Address second part of comment
3726b992ed (r50112970)
2026-03-19 21:52:12 +01:00
Hermès Bélusca-Maïto
bc7d0f1ec6 [NTOS:KD] i386/kdserial.c: Improve "Kernel Debugger:" messages; use correct default baud rate
- 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.
2026-03-19 21:52:10 +01:00
Hermès Bélusca-Maïto
d436f2e76b [EXT2FS] Fix an uninitialized variable usage RTC failure
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).
2026-03-18 21:11:35 +01:00
Hermès Bélusca-Maïto
530a48ce89 [CMAKE] Add the BCD hive only on EFI-compatible platforms
This excludes NEC PC-98 and Xbox.

CORE-16216, CORE-17977
2026-03-18 20:47:53 +01:00
Hermès Bélusca-Maïto
6a56468731 [BOOTDATA] Reorganize the mkisofs ISO boot-related options, making them modular (#4425)
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 ;)
2026-03-18 20:19:26 +01:00
Timo Kreuzer
31b1e2376a [OPENGL] Disable some GCC 13 warnings 2026-03-18 17:29:12 +02:00
Timo Kreuzer
d31b043fff [VCRUNTIME] comutil.h: Remove redundant _variant_t::operator VARIANT()
_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();
      |   ^~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
155970dca1 [RSHELL] Disable GCC 13 overloaded-virtual warning
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)
      |                           ^~~~~~~~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
bbce31f601 [UNIATA] Disable GCC 13 misleading-indentation warning
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));
      |     ^~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
782ffca2ce [ROSTESTS] Disable GCC 13 misleading-indentation warning
This warning is caused by todo_wine, etc.
2026-03-18 17:29:12 +02:00
Timo Kreuzer
54c20b83ff [OLEAUT32] Disable GCC 13 misleading-indentation warning
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)
      | ^~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
aa1cac9d22 [ACPI] Apply consistent indentation (tabs)
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);
      |         ^~~~~~~~~~~~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
9ef9bf5c25 [WININET] Fix missing braces (from wine-10.0)
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");
      |         ^~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
dbaf14d4a1 [SHELL32] Reduce diff to wine (indentation)
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);
      |         ^~~~~~~~~~~~~~~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
8187f60f00 [LIBTIFF] Disable GCC 13 array-parameter warning
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*);
      |                        ^~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
193b1eb1c4 [MSDMO] Disable GCC 13 array-parameter warning
Triggered by GCC 13:

C:/ReactOS/reactos/dll/directx/wine/msdmo/dmoreg.c:342:52: error: argument 2 of type 'WCHAR[]' {aka 'short unsigned int[]'} with mismatched bound [-Werror=array-parameter=]
  342 | HRESULT WINAPI DMOGetName(REFCLSID clsidDMO, WCHAR name[])
      |                                              ~~~~~~^~~~~~
In file included from C:/ReactOS/reactos/sdk/include/dxsdk/dmo.h:31,
                 from C:/ReactOS/reactos/dll/directx/wine/msdmo/dmoreg.c:31:
C:/ReactOS/reactos/sdk/include/dxsdk/dmoreg.h:47:36: note: previously declared as 'WCHAR[80]' {aka 'short unsigned int[80]'}
   47 | HRESULT WINAPI DMOGetName(REFCLSID,WCHAR[80]);
      |                                    ^~~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
1d292695fc [GLU32] Fix a parameter in gluTessVertex() declaration
Fixes GCC 13 warning:

C:/ReactOS/reactos/dll/opengl/glu32/src/libtess/tess.c:415:46: error: argument 2 of type 'GLdouble[3]' {aka 'double[3]'} with mismatched bound [-Werror=array-parameter=]
  415 | gluTessVertex( GLUtesselator *tess, GLdouble coords[3], void *data )
      |                                     ~~~~~~~~~^~~~~~~~~
In file included from C:/ReactOS/reactos/dll/opengl/glu32/src/libtess/mesh.h:38,
                 from C:/ReactOS/reactos/dll/opengl/glu32/src/libtess/tess.h:40,
                 from C:/ReactOS/reactos/dll/opengl/glu32/src/libtess/tess.c:40:
C:/ReactOS/reactos/dll/opengl/glu32/include/GL/glu.h:345:69: note: previously declared as 'GLdouble *' {aka 'double *'}
  345 | GLAPI void GLAPIENTRY gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data);
      |                                                           ~~~~~~~~~~^~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
74a0a56efc [RSAENH] Fix GCC 13 array-parameter warning
C:/ReactOS/reactos/dll/win32/rsaenh/sha2.c:507:29: error: argument 1 of type 'sha2_byte[]' {aka 'unsigned char[]'} with mismatched bound [-Werror=array-parameter=]
  507 | void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) {
      |                   ~~~~~~~~~~^~~~~~~~
In file included from C:/ReactOS/reactos/dll/win32/rsaenh/sha2.c:37:
C:/ReactOS/reactos/dll/win32/rsaenh/sha2.h:73:19: note: previously declared as 'sha2_byte[32]' {aka 'unsigned char[32]'}
   73 | void SHA256_Final(sha2_byte[SHA256_DIGEST_LENGTH], SHA256_CTX*);
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/ReactOS/reactos/dll/win32/rsaenh/sha2.c:570:44: error: argument 2 of type 'char[]' with mismatched bound [-Werror=array-parameter=]
  570 | char *SHA256_End(SHA256_CTX* context, char buffer[]) {
      |                                       ~~~~~^~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
db5bf7c828 [D3DX9_WINETEST] Disable GCC 13 sizeof-array-div warning
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[] =
      |                       ^~~~~~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
a217ad83a4 [DDRAW] Disable GCC 13 stringop-overflow warning
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,
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
3723e5a4dd [EXT2] Disable GCC 13 address-of-packed-member warning
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);
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
ddf58eb2f8 [VFATLIB] Add packing to LFN_ENT structure
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 {
      |         ^~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
daeb0bb257 [FTP] Fix invalid call to free()
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.
2026-03-18 17:29:12 +02:00
Timo Kreuzer
40378122c4 [SHLWAPI] Disable GCC 13 overloaded-virtual warning
This some C++ virtual inheritance nonsense. Someone familiar with this stuff should do a more proper fix.
2026-03-18 17:29:12 +02:00
Timo Kreuzer
46121f4643 [SHELL32] Disable GCC 13 overloaded-virtual warning
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)
      |                           ^~~~~~~~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
96a365e27d [ROSAUTOTEST] Fix invalid use of delete operator
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;
      |            ^~~~~~~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
b5e5debea5 [MMSYS] Don't compare array against NULL
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];
      |           ^~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
1c64719677 [CMD] Fix GCC 13 misleading-indentation warning
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);
      |                     ^~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
3413675193 [CMD] Clear global pointer to local variable after use
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;
      |              ^~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
f2b85d2a79 [CMD] Fix GCC 13 use-after-free warning
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));
      |            ^~~~~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
504ec9a619 [NSLOOKUP] Fix GCC 13 stringop-truncation warning
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) );
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2026-03-18 17:29:12 +02:00
Timo Kreuzer
af417da2f7 [MSPAINT] Don't use ZeroMemory on a non-POD object
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));
      |     ^~~~~~~~~~
2026-03-18 17:29:12 +02:00