mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-09-02 14:12:45 +02:00
Avoid GCC false positives
This commit is contained in:
2
Makefile
2
Makefile
@@ -164,7 +164,7 @@ endif
|
|||||||
|
|
||||||
# These must come before the -Wno- flags
|
# These must come before the -Wno- flags
|
||||||
WARNINGS += -Werror -Wall -Wno-unknown-warning -Wno-unknown-warning-option -Wno-missing-braces
|
WARNINGS += -Werror -Wall -Wno-unknown-warning -Wno-unknown-warning-option -Wno-missing-braces
|
||||||
WARNINGS += -Wno-nonnull -Wno-unused-result -Wno-multichar -Wno-int-in-bool-context
|
WARNINGS += -Wno-nonnull -Wno-unused-result -Wno-multichar -Wno-int-in-bool-context -Wno-format-truncation
|
||||||
|
|
||||||
# Only add this flag if the compiler supports it
|
# Only add this flag if the compiler supports it
|
||||||
ifeq ($(shell $(CC) -x c -c $(NULL) -o $(NULL) -Werror -Wpartial-availability 2> $(NULL); echo $$?),0)
|
ifeq ($(shell $(CC) -x c -c $(NULL) -o $(NULL) -Werror -Wpartial-availability 2> $(NULL); echo $$?),0)
|
||||||
|
@@ -4,6 +4,7 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <limits.h>
|
||||||
#include <OpenDialog/open_dialog.h>
|
#include <OpenDialog/open_dialog.h>
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
#include <Core/gb.h>
|
#include <Core/gb.h>
|
||||||
@@ -689,7 +690,7 @@ static void load_boot_rom(GB_gameboy_t *gb, GB_boot_rom_t type)
|
|||||||
};
|
};
|
||||||
bool use_built_in = true;
|
bool use_built_in = true;
|
||||||
if (configuration.bootrom_path[0]) {
|
if (configuration.bootrom_path[0]) {
|
||||||
static char path[4096];
|
static char path[PATH_MAX + 1];
|
||||||
snprintf(path, sizeof(path), "%s/%s", configuration.bootrom_path, names[type]);
|
snprintf(path, sizeof(path), "%s/%s", configuration.bootrom_path, names[type]);
|
||||||
use_built_in = GB_load_boot_rom(gb, path);
|
use_built_in = GB_load_boot_rom(gb, path);
|
||||||
}
|
}
|
||||||
@@ -890,7 +891,7 @@ restart:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static char prefs_path[1024] = {0, };
|
static char prefs_path[PATH_MAX + 1] = {0, };
|
||||||
|
|
||||||
static void save_configuration(void)
|
static void save_configuration(void)
|
||||||
{
|
{
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <limits.h>
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
static const char *resource_folder(void)
|
static const char *resource_folder(void)
|
||||||
@@ -18,7 +19,7 @@ static const char *resource_folder(void)
|
|||||||
|
|
||||||
char *resource_path(const char *filename)
|
char *resource_path(const char *filename)
|
||||||
{
|
{
|
||||||
static char path[1024];
|
static char path[PATH_MAX + 1];
|
||||||
|
|
||||||
snprintf(path, sizeof(path), "%s%s", resource_folder(), filename);
|
snprintf(path, sizeof(path), "%s%s", resource_folder(), filename);
|
||||||
#ifdef DATA_DIR
|
#ifdef DATA_DIR
|
||||||
|
Reference in New Issue
Block a user