From 2ab2a332a13f3012d660da1f10a71878d1a87790 Mon Sep 17 00:00:00 2001 From: Intel A80486DX2-66 Date: Sun, 4 Feb 2024 11:55:56 +0300 Subject: [PATCH] C: jokes/brexit.c: simplify, fix SIGSEGV Fix the indentation --- c-programming/jokes/brexit.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/c-programming/jokes/brexit.c b/c-programming/jokes/brexit.c index 445379c..9e4f25c 100644 --- a/c-programming/jokes/brexit.c +++ b/c-programming/jokes/brexit.c @@ -7,22 +7,23 @@ #include -__attribute__((naked)) __attribute__((noreturn)) _Noreturn void Brexit(void); +__attribute__((noreturn)) _Noreturn void Brexit(void); -__attribute__((naked)) __attribute__((noreturn)) _Noreturn void Brexit(void) { - __asm__ volatile ( - "movl $0x7F, %%ebx\n\t" - "movl $1, %%eax\n\t" - "int $0x80" - : - : - : "eax", "ebx" - ); + asm volatile ( + "movl $0x7F, %%ebx\n\t" + "movl $1, %%eax\n\t" + "int $0x80" + : + : + : "eax", "ebx" + ); + + for (;;); // https://stackoverflow.com/a/15964365 } int main(void) { - Brexit(); + Brexit(); }