我在使用 compiledb 执行 make 的时候,我在使用 compiledb 执行 make 的时候会有类似这种错误提示( https://github.com/nickdiego/compiledb/issues/96 , 这个网页里面也提到了):
```
## Processing build commands from <fdopen>
Line 1: Failed to parse build command [Details: (<class 'bashlex.tokenizer.MatchedPairError'>) unexpected EOF while looking for matching '`' (position 78)]. Ignoring: 'make: Entering directory `/c/sw_package/sources/iot/hello/src''
New command: C:\tools\MinGW\bin\gcc.exe -IC:\tools\MinGW\i686-w64-mingw32\include hello.c -v --debug -o hello.exe
Line 3: Failed to parse build command [Details: (<class 'bashlex.tokenizer.MatchedPairError'>) unexpected EOF while looking for matching '`' (position 77)]. Ignoring: 'make: Leaving directory `/c/sw_package/sources/iot/hello/src''
## Loaded compilation database with 0 entries from compile_commands.json
## Writing compilation database with 0 entries to compile_commands.json
## Done.
```
很明显,compiledb 因为这个路径两边的字符不一样而报错了。进而导致生成的`compile_commands.json`是一个空文件。

我又单独执行了 make ,发现确实是这样的,就是 make 时,出现 make: Entering directory 时,那个路径的两边字符就是不一样的,分别是反引号和单引号。
```
make: Entering directory `/c/sw_package/sources/iot/hello/src'
```

- 请问各位大佬,这是 make 的问题吗?
- 还是说,make 的输出就是对的没有问题,但是我得自己 特殊处理一下 make 的输出,再给到 compiledb ?
举报· 101 次点击
登录 注册 站外分享
3 条回复  
julyclyde 小成 2024-8-24 22:20:58
Make 的输出大体上是给人类看的东西
用文本内容做跨系统集成通常就会遇到你今天这种问题

看看有没有可以越过命令行直接调底层库的方法,把通信手段从文本解析改为 API 调用,试试?
agagega 小成 2024-8-25 00:41:47
https://english.stackexchange.com/questions/17695/any-reference-on-the-usage-of-a-backtick-and-single-quotation-mark-like-this

感觉只是打字机年代用来区分左右引号的习惯
vk42 小成 2024-8-25 03:19:01
@agagega 这是英语国家普遍都有的习惯吧,LaTeX 里面一般也这样用
返回顶部