编译报错backslash-newline

编译时遇到warning为warning: backslash-newline at end of file

源码为

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#pragma once

#define print(x) \
do \
{ \
int size=sizeof(x); \
if(size<=4) \
{ \
__asm__("mov $0x3f8, %%dx\n\t" \
"out %%eax, %%dx\n\t" \
: \
: "a"(x) \
: "dx" \
); \
} \
else if(size==8) \
{ \
__asm__("mov $0x3f8, %%dx\n\t" \
"out %%eax, %%dx\n\t" \
"shr $32, %%rax\n\t" \
"out %%eax, %%dx\n\t" \
: \
: "a"(x) \
: "dx" \
); \
} \
} while (0)

在文件末尾添加新的空白行即可


编译报错backslash-newline
https://bannirui.github.io/2024/06/16/C/编译报错backslash-newline/
作者
dingrui
发布于
2024年6月16日
许可协议