This repository was archived by the owner on Jan 17, 2026. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +13
-11
lines changed
Expand file tree Collapse file tree 3 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -25,8 +25,8 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
2525# Compiler flags
2626set (CMAKE_C_FLAGS_DEBUG "-g -O0 -Wall -Werror -Wno-unused-command-line-argument -Wno-implicit-fallthrough -Wno-unused-result" )
2727set (CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -Werror -Wno-sign-compare -Wno-unused-command-line-argument -Wno-implicit-fallthrough -Wno-unused-result" )
28- set (CMAKE_C_FLAGS_RELEASE "-O3 -Wall -Werror -flto -Wno-unused-command-line-argument -Wno-implicit-fallthrough -Wno-unused-result" )
29- set (CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -Werror -Wno-sign-compare -flto -Wno-unused-command-line-argument -Wno-implicit-fallthrough -Wno-unused-result" )
28+ set (CMAKE_C_FLAGS_RELEASE "-O3 -Wall -Werror -flto -Wno-unused-command-line-argument -Wno-implicit-fallthrough -Wno-unused-result -DNDEBUG " )
29+ set (CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -Werror -Wno-sign-compare -flto -Wno-unused-command-line-argument -Wno-implicit-fallthrough -Wno-unused-result -DNDEBUG " )
3030
3131# Prefer LLVM tools when using Clang (helps with -flto)
3232if (CMAKE_C_COMPILER_ID MATCHES "Clang" )
Original file line number Diff line number Diff line change 1515 */
1616
1717#include < cassert>
18+ #include < cstdlib>
1819#include < cstring>
1920#include < signal.h>
2021#include < sys/time.h>
@@ -58,15 +59,22 @@ void alarm_init() {
5859 };
5960
6061 int ret = sigaction (SIGVTALRM, &s, nullptr );
61- assert (ret == 0 );
62+ if (ret)
63+ goto fail;
6264
6365 struct itimerval it;
6466 memset (&it, 0 , sizeof (it));
6567 it.it_value .tv_sec = 0 ;
6668 it.it_value .tv_usec = 1000000 / TIMER_HZ;
6769 it.it_interval = it.it_value ;
6870 ret = setitimer (ITIMER_VIRTUAL, &it, NULL );
69- assert (ret == 0 );
71+ if (ret)
72+ goto fail;
7073
7174 log_info (" Alarm initialized" );
75+ return ;
76+
77+ fail:
78+ log_error (" Alarm init failed" );
79+ exit (EXIT_FAILURE);
7280}
Original file line number Diff line number Diff line change 1919
2020#include "simple-uart.h"
2121
22- uint64_t simple_uart_read (uint64_t addr , size_t n ) {
23- uint64_t off = addr - SIMPLE_UART_BASE_ADDR ;
24- assert (off == 0 );
25- return -1 ;
26- }
22+ uint64_t simple_uart_read (uint64_t addr , size_t n ) { return -1 ; }
2723
2824void simple_uart_write (uint64_t addr , uint64_t value , size_t n ) {
29- uint64_t off = addr - SIMPLE_UART_BASE_ADDR ;
30- assert (off == 0 && n == 4 );
3125 putchar ((int )value );
3226}
You can’t perform that action at this time.
0 commit comments