warning: backslash and newline separated by space

本文探讨了一段代码中出现警告提示的原因及解决方法,通过移除特定字符避免警告出现,提供了解决代码问题的有效策略。

在写下面代码时候出现警告提示:

	char m_SPS[256] =   {   0x67, 0x64, 0x00, 0x28, 0xAD, 0x84, 0x05, 0x45, 0x62, 0xB8, 0xAC, 0x54, 0x74, 0x20, 0x2A, 0x2B,	\
 						0x15, 0xC5, 0x62, 0xA3, 0xA1, 0x01, 0x51, 0x58, 0xAE, 0x2B, 0x15, 0x1D, 0x08, 0x0A, 0x8A, 0xC5,	\
 						0x71, 0x58, 0xA8, 0xE8, 0x40, 0x54, 0x56, 0x2B, 0x8A, 0xC5, 0x47, 0x42, 0x02, 0xA2, 0xB1, 0x5C,	\
 						0x56, 0x2A, 0x3A, 0x10, 0x24, 0x85, 0x21, 0x39, 0x3C, 0x9F, 0x27, 0xE4, 0xFE, 0x4F, 0xC9, 0xF2, 	\
 						0x79, 0xB9, 0xB3, 0x4D, 0x08, 0x12, 0x42, 0x90, 0x9C, 0x9E, 0x4F, 0x93, 0xF2, 0x7F, 0x27, 0xE4,	\
 						0xF9, 0x3C, 0xDC, 0xD9, 0xA6, 0xB4 ,0x05, 0x01, 0xED, 0x2A, 0x40, 0x00, 0x04, 0xE2, 0x00, 0x00,	\
						0x57, 0xE4, 0x18, 0x10, 0x00, 0x72, 0x40, 0x00, 0x06, 0x06, 0x7A, 0xF7, 0xBE, 0x17, 0x84, 0x42,	\
 						0x35};

原因是警告的对应行的“\”后面有空格,去掉就OK了。
linux在编译的时候出现以下问题: CC minidlna.o In file included from minidlna.h:48:0, from minidlna.c:50: sql.h:42:14: error: unknown type name &#39;sqlite3&#39; int sql_exec(sqlite3 *db, const char *fmt, ...); ^~~~~~~ sql.h:43:19: error: unknown type name &#39;sqlite3&#39; int sql_get_table(sqlite3 *db, const char *zSql, char ***pazResult, int *pnRow, int *pnColumn); ^~~~~~~ sql.h:44:23: error: unknown type name &#39;sqlite3&#39; int sql_get_int_field(sqlite3 *db, const char *fmt, ...); ^~~~~~~ sql.h:45:29: error: unknown type name &#39;sqlite3&#39; int64_t sql_get_int64_field(sqlite3 *db, const char *fmt, ...); ^~~~~~~ sql.h:46:27: error: unknown type name &#39;sqlite3&#39; char * sql_get_text_field(sqlite3 *db, const char *fmt, ...); ^~~~~~~ sql.h:47:16: error: unknown type name &#39;sqlite3&#39; int db_upgrade(sqlite3 *db); ^~~~~~~ In file included from minidlna.c:50:0: minidlna.h:72:3: warning: #warning "Your SQLite3 library appears to be too old! Please use 3.5.1 or newer." [-Wcpp] # warning "Your SQLite3 library appears to be too old! Please use 3.5.1 or newer." ^~~~~~~ minidlna.h:104:13: error: unknown type name &#39;sqlite3&#39; int open_db(sqlite3 **sq3); ^~~~~~~ minidlna.h:117:15: error: unknown type name &#39;sqlite3&#39; void check_db(sqlite3 *db, int new_db); ^~~~~~~ In file included from minidlna.c:52:0: upnpglobalvars.h:191:40: warning: backslash and newline separated by space "http-get:*:audio/x-monkeys-audio:*," \ upnpglobalvars.h:247:8: error: unknown type name &#39;sqlite3&#39; extern sqlite3 *db; ^~~~~~~ minidlna.c: In function &#39;init&#39;: minidlna.c:1014:2: warning: statement with no effect [-Wunused-value] for (failnums; failnums < 10; failnums++) ^~~ minidlna.c: In function &#39;main&#39;: minidlna.c:1377:6: error: implicit declaration of function &#39;sqlite3_libversion_number&#39; [-Werror=implicit-function-declaration] if (sqlite3_libversion_number() < 3005001) ^~~~~~~~~~~~~~~~~~~~~~~~~ minidlna.c:1567:20: error: implicit declaration of function &#39;sqlite3_total_changes&#39;; did you mean &#39;sqlite3_threadsafe&#39;? [-Werror=implicit-function-declaration] if (scanning || sqlite3_total_changes(db) != last_changecnt) ^~~~~~~~~~~~~~~~~~~~~ sqlite3_threadsafe minidlna.c: In function &#39;minidlnaStart&#39;: minidlna.c:1674:2: error: implicit declaration of function &#39;sqlite3_initialize&#39;; did you mean &#39;sqlite3_malloc&#39;? [-Werror=implicit-function-declaration] sqlite3_initialize(); ^~~~~~~~~~~~~~~~~~ sqlite3_malloc minidlna.c: In function &#39;minidlnaShutdown&#39;: minidlna.c:1818:8: error: implicit declaration of function &#39;sqlite3_close&#39;; did you mean &#39;sqlite3_malloc&#39;? [-Werror=implicit-function-declaration] ret = sqlite3_close(db); ^~~~~~~~~~~~~ sqlite3_malloc minidlna.c:1819:6: error: &#39;SQLITE_OK&#39; undeclared (first use in this function) if (SQLITE_OK != ret) ^~~~~~~~~ minidlna.c:1819:6: note: each undeclared identifier is reported only once for each function it appears in minidlna.c:1826:8: error: implicit declaration of function &#39;sqlite3_shutdown&#39;; did you mean &#39;sqlite3_malloc&#39;? [-Werror=implicit-function-declaration] ret = sqlite3_shutdown(); ^~~~~~~~~~~~~~~~ sqlite3_malloc minidlna.c: At top level: minidlna.c:1851:13: error: unknown type name &#39;sqlite3&#39; int open_db(sqlite3 **sq3) ^~~~~~~ minidlna.c:1917:15: error: unknown type name &#39;sqlite3&#39; void check_db(sqlite3 *db, int new_db) ^~~~~~~ minidlna.c: In function &#39;minidlna_startScannerThread&#39;: minidlna.c:2067:8: error: implicit declaration of function &#39;open_db&#39;; did you mean &#39;opendir&#39;? [-Werror=implicit-function-declaration] ret = open_db(NULL); ^~~~~~~ opendir minidlna.c:2095:14: error: implicit declaration of function &#39;sql_get_int_field&#39; [-Werror=implicit-function-declaration] updateID = sql_get_int_field(db, "SELECT VALUE from SETTINGS where KEY = &#39;UPDATE_ID&#39;"); ^~~~~~~~~~~~~~~~~ minidlna.c:2103:2: error: implicit declaration of function &#39;check_db&#39; [-Werror=implicit-function-declaration] check_db(db, ret); ^~~~~~~~ At top level: minidlna.c:193:12: warning: &#39;l_rescanFlag&#39; defined but not used [-Wunused-variable] static int l_rescanFlag = 0;
08-19
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值