warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]
时间: 2024-04-29 20:21:42 浏览: 176
这个警告表示在字面量和标识符之间缺少空格,而在 C++11 中需要添加空格。例如,在使用后缀的浮点字面量时,应该这样写:
```cpp
float myFloat = 3.14f;
```
而不是这样写:
```cpp
float myFloat = 3.14fMySuffix;
```
将 `f` 和 `MySuffix` 之间添加一个空格即可解决这个警告。
相关问题
/gcc/defaults.h:126:24: 警告:invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
This warning indicates that there is an issue with the syntax used in the code. Specifically, the warning is indicating that there is an invalid suffix on a literal in the code. The C 11 standard requires that there be a space between a literal and a string macro. This warning is telling you that there is no space between the literal and the string macro in the code, which is not compliant with the C 11 standard. To fix this warning, you should add a space between the literal and the string macro in the code.
阅读全文