diff --git a/Makefile.emscripten b/Makefile.emscripten index fb74177eed80..967d9d247f09 100644 --- a/Makefile.emscripten +++ b/Makefile.emscripten @@ -312,7 +312,7 @@ endif ifeq ($(DEBUG), 1) LDFLAGS += -O0 -g -gsource-map -s STACK_OVERFLOW_CHECK=2 # -O0 in cflags gives "too many locals" errors - CFLAGS += -O1 -g -gsource-map + CFLAGS += -O1 -g -gsource-map -Wall -Werror override ASSERTIONS = 1 # "WASM_WORKERS is not currently compatible with `-fsanitize` tools" ifeq ($(WASM_WORKERS), 0) diff --git a/audio/common/pipewire.c b/audio/common/pipewire.c index e6f506099b2c..f81db9a64b75 100644 --- a/audio/common/pipewire.c +++ b/audio/common/pipewire.c @@ -27,9 +27,11 @@ static void core_error_cb(void *data, uint32_t id, int seq, int res, const char { pipewire_core_t *pw = (pipewire_core_t*)data; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" RARCH_ERR("[PipeWire] Error id:%u seq:%d res:%d (%s): %s.\n", id, seq, res, spa_strerror(res), message); - +#pragma GCC diagnostic pop pw_thread_loop_stop(pw->thread_loop); } @@ -54,8 +56,10 @@ static const struct pw_core_events core_events = { void pipewire_core_wait_resync(pipewire_core_t *pw) { retro_assert(pw); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" pw->pending_seq = pw_core_sync(pw->core, PW_ID_CORE, pw->pending_seq); - +#pragma GCC diagnostic pop for (;;) { pw_thread_loop_wait(pw->thread_loop); @@ -116,16 +120,21 @@ bool pipewire_core_init(pipewire_core_t **pw, const char *loop_name, const struc if (!(*pw)->core) goto unlock; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" if (pw_core_add_listener((*pw)->core, &(*pw)->core_listener, &core_events, *pw) < 0) goto unlock; - +#pragma GCC diagnostic pop if (events) { (*pw)->registry = pw_core_get_registry((*pw)->core, PW_VERSION_REGISTRY, 0); spa_zero((*pw)->registry_listener); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" pw_registry_add_listener((*pw)->registry, &(*pw)->registry_listener, events, *pw); +#pragma GCC diagnostic pop } return true; diff --git a/audio/common/pipewire.h b/audio/common/pipewire.h index 7156c9bc4602..66b09dbaa256 100644 --- a/audio/common/pipewire.h +++ b/audio/common/pipewire.h @@ -18,10 +18,12 @@ #define _RETROARCH_PIPEWIRE #include - +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" #include #include #include +#pragma GCC diagnostic pop #include diff --git a/audio/drivers/alsathread.c b/audio/drivers/alsathread.c index 62068182a429..97dee6a1e790 100644 --- a/audio/drivers/alsathread.c +++ b/audio/drivers/alsathread.c @@ -216,7 +216,7 @@ static int alsa_thread_microphone_read(void *driver_context, void *mic_context, { snd_pcm_state_t state; size_t _len = 0; - uint8_t *s = (uint8_t*)sv; + uint8_t *s = (uint8_t *)sv; alsa_thread_microphone_t *alsa = (alsa_thread_microphone_t*)driver_context; alsa_thread_microphone_handle_t *mic = (alsa_thread_microphone_handle_t*)mic_context; diff --git a/audio/drivers/pipewire.c b/audio/drivers/pipewire.c index 46f9bff4d6e2..02f8f9e1016d 100644 --- a/audio/drivers/pipewire.c +++ b/audio/drivers/pipewire.c @@ -12,12 +12,14 @@ * You should have received a copy of the GNU General Public License along with RetroArch. * If not, see . */ - +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" #include #include #include #include #include +#pragma GCC diagnostic pop #include #include @@ -220,8 +222,10 @@ static void *pwire_microphone_init(void) struct pw_properties *props = NULL; const char *error = NULL; pipewire_core_t *pw = NULL; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer)); - +#pragma GCC diagnostic pop if (!pipewire_core_init(&pw, "microphone_driver", &pwire_mic_registry_events)) goto error; @@ -340,7 +344,10 @@ static void *pwire_microphone_open_mic(void *driver_context, const struct spa_pod *params[1]; struct pw_properties *props = NULL; const char *error = NULL; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer)); +#pragma GCC diagnostic pop pipewire_microphone_t *mic = NULL; if (!driver_context || (mic = calloc(1, sizeof(pipewire_microphone_t))) == NULL) @@ -604,7 +611,10 @@ static void *pwire_init(const char *device, unsigned rate, struct pw_properties *props = NULL; const char *error = NULL; pipewire_audio_t *audio = (pipewire_audio_t*)calloc(1, sizeof(*audio)); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer)); +#pragma GCC diagnostic pop if (!audio) return NULL; diff --git a/camera/drivers/pipewire.c b/camera/drivers/pipewire.c index d868650771fb..c421c786b3fa 100644 --- a/camera/drivers/pipewire.c +++ b/camera/drivers/pipewire.c @@ -13,6 +13,8 @@ * If not, see . */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" #include #include #include @@ -21,6 +23,7 @@ #include #include #include +#pragma GCC diagnostic pop #include #include @@ -209,8 +212,10 @@ static void stream_param_changed_cb(void *data, uint32_t id, const struct spa_po uint8_t params_buffer[1024]; const struct spa_pod *params[5]; pipewire_camera_t *camera = (pipewire_camera_t*)data; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" struct spa_pod_builder b = SPA_POD_BUILDER_INIT(params_buffer, sizeof(params_buffer)); - +#pragma GCC diagnostic pop if (param && id == SPA_PARAM_Tag) { spa_debug_pod(0, NULL, param); @@ -258,6 +263,8 @@ static void stream_param_changed_cb(void *data, uint32_t id, const struct spa_po return; } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" struct spa_pod_frame frame; spa_pod_builder_push_object(&b, &frame, SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers); spa_pod_builder_add(&b, @@ -270,7 +277,6 @@ static void stream_param_changed_cb(void *data, uint32_t id, const struct spa_po 0); params[0] = spa_pod_builder_pop(&b, &frame); - params[1] = spa_pod_builder_add_object(&b, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, SPA_POD_Id(SPA_META_Header), @@ -281,6 +287,7 @@ static void stream_param_changed_cb(void *data, uint32_t id, const struct spa_po SPA_PARAM_META_type, SPA_POD_Id(SPA_META_VideoTransform), SPA_PARAM_META_size, SPA_POD_Int(sizeof(struct spa_meta_videotransform))); #endif +#pragma GCC diagnostic pop camera->buffer_output = (uint32_t *) malloc(camera->size.width * camera->size.height * sizeof(uint32_t)); @@ -372,8 +379,11 @@ static void *pipewire_init(const char *device, uint64_t caps, struct pw_properties *props; uint8_t buffer[1024]; pipewire_camera_t *camera = (pipewire_camera_t*)calloc(1, sizeof(*camera)); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer)); - +#pragma GCC diagnostic pop + if (!camera) goto error; @@ -420,7 +430,10 @@ static void *pipewire_init(const char *device, uint64_t caps, if (res < 0) { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" RARCH_ERR("[Camera] [PipeWire] Can't connect: %s.\n", spa_strerror(res)); +#pragma GCC diagnostic pop goto error; } diff --git a/gfx/common/wayland_common.c b/gfx/common/wayland_common.c index d1205360774e..e0620f4df456 100644 --- a/gfx/common/wayland_common.c +++ b/gfx/common/wayland_common.c @@ -660,7 +660,6 @@ static void shm_buffer_paint_checkerboard( } } } - static bool wl_draw_splash_screen(gfx_ctx_wayland_data_t *wl) { if (wl->single_pixel_manager) diff --git a/gfx/video_crt_switch.c b/gfx/video_crt_switch.c index eab7173ab7d9..abebe96e4336 100644 --- a/gfx/video_crt_switch.c +++ b/gfx/video_crt_switch.c @@ -183,6 +183,7 @@ static bool crt_sr2_init(videocrt_switch_t *p_switch, void (*dbgp)(const char *, ...) = &RARCH_DBG; void (*errp)(const char *, ...) = &RARCH_ERR; sr_init(); + sr_set_log_callback_info(*(void **)(&logp)); sr_set_log_callback_debug(*(void **)(&dbgp)); sr_set_log_callback_error(*(void **)(&errp)); diff --git a/input/bsv/uint32s_index.c b/input/bsv/uint32s_index.c index 4694c7e8895c..663f71e9c94d 100644 --- a/input/bsv/uint32s_index.c +++ b/input/bsv/uint32s_index.c @@ -35,7 +35,10 @@ uint32s_index_t *uint32s_index_new(size_t object_size, uint32s_index_t *index = (uint32s_index_t *)malloc(sizeof(uint32s_index_t)); index->object_size = object_size; index->index = NULL; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wtautological-compare" RHMAP_FIT(index->index, HASHMAP_CAP); +#pragma GCC diagnostic pop index->objects = NULL; index->counts = NULL; index->hashes = NULL; diff --git a/libretro-common/net/cacert.h b/libretro-common/net/cacert.h index d1d57171d76d..9056b09c8f17 100644 --- a/libretro-common/net/cacert.h +++ b/libretro-common/net/cacert.h @@ -2,6 +2,9 @@ * https://curl.haxx.se/docs/caextract.html * NOTE: Newlines are necessary for the file to be parsed correctly! */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Woverlength-strings" + static const char cacert_pem[] = { "##\n" "## Bundle of CA Root Certificates\n" @@ -3803,3 +3806,5 @@ static const char cacert_pem[] = { "q5Rm+K37DwhuJi1/FwcJsoz7UMCflo3Ptv0AnVoUmr8CRPXBwp8iXqIPoeM=\n" "-----END CERTIFICATE-----\n" }; + +#pragma GCC diagnostic pop diff --git a/tasks/task_autodetect.c b/tasks/task_autodetect.c index 80df9f981bcb..06fe4c8d6784 100644 --- a/tasks/task_autodetect.c +++ b/tasks/task_autodetect.c @@ -509,8 +509,8 @@ static void reallocate_port_if_needed( || string_is_equal(device_display_name, settings_value_device_name); } else - device_has_reserved_slot = ( vendor_id == settings_value_vendor_id - && product_id == settings_value_product_id); + device_has_reserved_slot = ( vendor_id == (int)settings_value_vendor_id + && product_id == (int)settings_value_product_id); if (device_has_reserved_slot) {