Clion 警告 glm::dot returnType 但无论如何编译
Clion warns about glm::dot returnType but compiles anyways
GLfloat test = glm::dot(glm::vec3(1.0f,1.0f,1.0f),glm::vec3(1.0f,1.0f,1.0f));
编译并工作正常,但 Clion-IDE 坚持认为有错误。
Types 'GLfloat' and 'glm::highp_vec3' are not compatible.
我是否必须取消警告,或者是否有更优雅的方法来解决这个问题。
不幸的是,CLion 选择实现自己的 C++ 解析器 (using ANTLR),它并不完美,尽管它正在变得更好。所以在编译器成功编译代码的情况下出现检查警告的原因是 CLion 解析器在某处出错。您的编译器是理解 C++ 的更好来源,因为……好吧,它是一个编译器。
要关闭检查警告,您可以执行以下操作之一:
Suppressing inspections in the editor
- Set the cursor to the highlighted code issue in the editor.
- Press Alt+Enter, or click the light bulb icon intentionBulb to expand the suggestion list.
- Depending on the issue, you will see either quick-fixes related to the inspection or the Inspection "" options item.
- Use the up/down arrow keys to select this item and then press the right arrow key or just click the right arrow rightArrowInMenu next
to this item. Pressing the left arrow key, or Escape hides the
suggestion list.
- In the inspection options list, select the desired suppress action: The inspection will be suppressed with special comments in the
corresponding piece of code.
或
Suppressing inspections from the Inspection tool window
- After running code analysis, select a code issue, for which you want to suppress the inspection, in the Inspection tool window.
- Click hectorBack on the toolbar of the Inspection tool window, or just right-click the selected inspection.
- Choose the desired suppress action. For example: The inspection will be suppressed with special comments in the corresponding piece of
code.
来源:https://www.jetbrains.com/help/clion/2016.1/suppressing-inspections.html
GLfloat test = glm::dot(glm::vec3(1.0f,1.0f,1.0f),glm::vec3(1.0f,1.0f,1.0f));
编译并工作正常,但 Clion-IDE 坚持认为有错误。
Types 'GLfloat' and 'glm::highp_vec3' are not compatible.
我是否必须取消警告,或者是否有更优雅的方法来解决这个问题。
CLion 选择实现自己的 C++ 解析器 (using ANTLR),它并不完美,尽管它正在变得更好。所以在编译器成功编译代码的情况下出现检查警告的原因是 CLion 解析器在某处出错。您的编译器是理解 C++ 的更好来源,因为……好吧,它是一个编译器。
要关闭检查警告,您可以执行以下操作之一:
Suppressing inspections in the editor
- Set the cursor to the highlighted code issue in the editor.
- Press Alt+Enter, or click the light bulb icon intentionBulb to expand the suggestion list.
- Depending on the issue, you will see either quick-fixes related to the inspection or the Inspection "" options item.
- Use the up/down arrow keys to select this item and then press the right arrow key or just click the right arrow rightArrowInMenu next to this item. Pressing the left arrow key, or Escape hides the suggestion list.
- In the inspection options list, select the desired suppress action: The inspection will be suppressed with special comments in the corresponding piece of code.
或
Suppressing inspections from the Inspection tool window
- After running code analysis, select a code issue, for which you want to suppress the inspection, in the Inspection tool window.
- Click hectorBack on the toolbar of the Inspection tool window, or just right-click the selected inspection.
- Choose the desired suppress action. For example: The inspection will be suppressed with special comments in the corresponding piece of code.
来源:https://www.jetbrains.com/help/clion/2016.1/suppressing-inspections.html