:: commit ee5e776c2cbe709a516b4c18a7c8b3201a3f8115

mintsuki <mintsuki@protonmail.com> — 2022-03-17 21:47

parents: 50076656f4

test: Minor changes

diff --git a/test/GNUmakefile b/test/GNUmakefile
index 878f7bd2..4aa3098a 100644
--- a/test/GNUmakefile
+++ b/test/GNUmakefile
@@ -1,5 +1,5 @@
 CC              = cc
-CFLAGS          = -O2 -g
+CFLAGS          = -O2 -g -Wall -Wextra -Wpedantic
 LDFLAGS         =
 LD              = ld
 QEMU            = qemu-system-x86_64
@@ -32,7 +32,7 @@ INTERNALCFLAGS  :=       \
 	-I../stivale         \
 	-I.                  \
 	-I../common          \
-	-std=gnu11           \
+	-std=c11             \
 	-ffreestanding       \
 	-fno-stack-protector \
 	-fpie                \
diff --git a/test/e9print.c b/test/e9print.c
index 2895b1bf..fc0ecd13 100644
--- a/test/e9print.c
+++ b/test/e9print.c
@@ -8,7 +8,7 @@ static const char CONVERSION_TABLE[] = "0123456789abcdef";
 void e9_putc(char c) {
     if (stivale2_print != NULL)
         stivale2_print(&c, 1);
-    asm volatile ("outb %0, %1" :: "a" (c), "Nd" (0xe9) : "memory");
+    __asm__ __volatile__ ("outb %0, %1" :: "a" (c), "Nd" (0xe9) : "memory");
 }
 
 void e9_print(const char *msg) {
diff --git a/test/limine.c b/test/limine.c
index fe23842b..dd8024c4 100644
--- a/test/limine.c
+++ b/test/limine.c
@@ -5,46 +5,39 @@
 
 static void limine_main(void);
 
-__attribute__((used))
-static struct limine_framebuffer_request framebuffer_request = {
-    .id = LIMINE_FRAMEBUFFER_REQUEST,
-    .flags = 0, .response = NULL
-};
-
-__attribute__((used))
-static struct limine_entry_point_request entry_point_request = {
+struct limine_entry_point_request entry_point_request = {
     .id = LIMINE_ENTRY_POINT_REQUEST,
     .flags = 0, .response = NULL,
 
     .entry = limine_main
 };
 
-__attribute__((used))
-static struct limine_boot_info_request boot_info_request = {
+struct limine_framebuffer_request framebuffer_request = {
+    .id = LIMINE_FRAMEBUFFER_REQUEST,
+    .flags = 0, .response = NULL
+};
+
+struct limine_boot_info_request boot_info_request = {
     .id = LIMINE_BOOT_INFO_REQUEST,
     .flags = 0, .response = NULL
 };
 
-__attribute__((used))
-static struct limine_memmap_request memmap_request = {
+struct limine_memmap_request memmap_request = {
     .id = LIMINE_MEMMAP_REQUEST,
     .flags = 0, .response = NULL
 };
 
-__attribute__((used))
-static struct limine_module_request module_request = {
+struct limine_module_request module_request = {
     .id = LIMINE_MODULE_REQUEST,
     .flags = 0, .response = NULL
 };
 
-__attribute__((used))
-static struct limine_rsdp_request rsdp_request = {
+struct limine_rsdp_request rsdp_request = {
     .id = LIMINE_RSDP_REQUEST,
     .flags = 0, .response = NULL
 };
 
-__attribute__((used))
-static struct limine_smbios_request smbios_request = {
+struct limine_smbios_request smbios_request = {
     .id = LIMINE_SMBIOS_REQUEST,
     .flags = 0, .response = NULL
 };
diff --git a/test/stivale2.c b/test/stivale2.c
index 0219de75..cb5e59ee 100644
--- a/test/stivale2.c
+++ b/test/stivale2.c
@@ -58,7 +58,7 @@ static volatile int cpu_up = 0;
 static void ap_entry(struct stivale2_smp_info *s) {
     e9_printf("            AP %d started", s->lapic_id);
     cpu_up = 1;
-    for (;;) asm("hlt");
+    for (;;) __asm__("hlt");
 }
 
 static void print_guid(struct stivale2_guid guid) {
@@ -277,5 +277,5 @@ void stivale2_main(struct stivale2_struct *info) {
     }
 
     // Enter our sublime pale slumber.
-    for (;;) asm("hlt");
+    for (;;) __asm__("hlt");
 }
tab: 248 wrap: offon