Compare commits

...

3 Commits

Author SHA1 Message Date
comex
3197b1e25b nanovg: disable some compiler warnings
Disable all warnings seen on devkitA64 GCC 15.1.0:

- Several false-positive `-Wmisleading-indentation` warnings (the
  indentation is not actually misleading)

- One `-Wuse-after-free` warning, which looks alarming and represents
  very dubious design, but is ultimately harmless (a freed pointer is
  passed to a function that doesn't use it).

- Some `-Wunused-function` warnings in `simd/neon.h`
2025-08-08 14:16:03 -07:00
comex
822cbbbc8b daybreak: fix strncpy compiler warning
GCC warned that the output string would not be nul-terminated if the
input string was too long.  Fix this by subtracting 1 from the size
argument, as is done for other `strncpy` calls in the file.  (It would
probably be better to avoid `strncpy` entirely, but this is just a
simple fix.)
2025-08-08 14:16:03 -07:00
comex
4237f52ee2 haze: fix duplicate-macro warnings
haze was including both `<switch.h>` and `vapours/types.hpp` which both
define `R_SUCCEEDED` and `R_FAILED`, producing compiler warnings.

The intent is that `vapours/types.hpp` only gets included when targeting
not-Switch and/or not-EL0.  But the check didn't account for
Troposphère.  Fix that.
2025-08-08 14:16:03 -07:00
4 changed files with 9 additions and 4 deletions

View File

@ -44,8 +44,9 @@
#include <bit>
#include <span>
/* Stratosphere wants additional libstdc++ headers, others do not. */
#ifdef ATMOSPHERE_IS_STRATOSPHERE
/* Stratosphere/Troposphere want additional libstdc++ headers and libnx,
* others do not. */
#if defined(ATMOSPHERE_IS_STRATOSPHERE) || defined(ATMOSPHERE_IS_TROPOSPHERE)
#include <memory>
#include <mutex>
@ -71,7 +72,7 @@
/* Non-EL0 code can't include libnx. */
#include "types.hpp"
#endif /* ATMOSPHERE_IS_STRATOSPHERE */
#endif /* defined(ATMOSPHERE_IS_STRATOSPHERE) || defined(ATMOSPHERE_IS_TROPOSPHERE) */
/* Atmosphere meta. */
#include <vapours/ams_version.h>

View File

@ -50,6 +50,8 @@ ARCH := -march=armv8-a+crc+crypto -mtune=cortex-a57 -mtp=soft -fPIE
CFLAGS := -g -Wall -O2 -ffunction-sections \
$(ARCH) $(DEFINES)
CFLAGS += -Wno-misleading-indentation -Wno-use-after-free -Wno-unused-function
CFLAGS += $(INCLUDE) -D__SWITCH__
CXXFLAGS := $(CFLAGS) -std=gnu++17 -fno-exceptions -fno-rtti

View File

@ -1277,7 +1277,7 @@ namespace dbk {
if (InitializeMenu(screen_width, screen_height)) {
/* Set the update path. */
strncpy(g_update_path, update_path, sizeof(g_update_path));
strncpy(g_update_path, update_path, sizeof(g_update_path)-1);
/* Change the menu. */
ChangeMenu(std::make_shared<ValidateUpdateMenu>(g_current_menu));

View File

@ -15,7 +15,9 @@
*/
#pragma once
#define ATMOSPHERE_IS_TROPOSPHERE
#define ATMOSPHERE_OS_HORIZON
#define ATMOSPHERE_BOARD_NINTENDO_NX
#define ATMOSPHERE_ARCH_ARM64
#define ATMOSPHERE_ARCH_ARM_V8A