use unused

This commit is contained in:
sfja 2025-04-01 17:19:26 +02:00
parent 0bdbaa7f1f
commit b451548bec
5 changed files with 10 additions and 7 deletions

View File

@ -4,11 +4,11 @@ MAKEFLAGS += -j $(shell nproc)
CC = gcc
C_FLAGS = \
-I. \
-std=c17 \
-Wall -Wextra -Wpedantic -Wconversion \
-pedantic -pedantic-errors \
-Wno-unused-variable \
-I. \
-Wno-unused-function \
L_FLAGS = -pthread
@ -26,7 +26,7 @@ ifeq ($(RELEASE),1)
F_FLAGS += -flto=auto
OPTIMIZATION += -O3
else
C_FLAGS += -g
C_FLAGS += -g -Wno-unused-variable
F_FLAGS += -fsanitize=address,undefined,leak
OPTIMIZATION += -Og
endif

3
common/unused.h Normal file
View File

@ -0,0 +1,3 @@
#pragma once
#define UNUSED __attribute__((unused))

View File

@ -7,7 +7,5 @@
-pedantic
-pedantic-errors
-Wno-unused-variable
# -Wno-unused-parameter
# -Wno-unused-function
-I.

View File

@ -376,7 +376,7 @@ void filedrive_construct(
.drive = (Drive) {
.self = drive,
.block_size = block_size,
.block_amount = block_size,
.block_amount = block_amount,
.read = filedrive_drive_read,
.write = filedrive_drive_write,
},

View File

@ -1,6 +1,7 @@
#include "vm.h"
#include "common/arch.h"
#include "common/op_str.h"
#include "common/unused.h"
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
@ -413,7 +414,8 @@ static inline void handle_device_read(VM* vm, Reg dst_reg, uint16_t device_id)
}
}
static inline void handle_device_write(VM* vm, uint16_t op1, uint16_t device_id)
static inline void handle_device_write(
UNUSED VM* vm, UNUSED uint16_t op1, uint16_t device_id)
{
switch (device_id) {
default: