View Issue Details

IDProjectCategoryView StatusLast Update
0002171NoesisGUIC++ SDKpublic2021-11-23 17:00
Reporterpdx_lysannschlegel Assigned Tojsantos  
PrioritynormalSeverityminor 
Status resolvedResolutionfixed 
Product Version3.1 
Target Version3.1.2Fixed in Version3.1.2 
Summary0002171: clang warning in NsMath/Vector.h (ignored-qualifiers)
Description

When building anything that includes NsMath/Vector.h with clang version at least 10, and -Wignored-qualifiers enabled, the warning is triggered in several places:

Include/NsMath/Vector.h:36:5: error: 'const' type qualifier on return type has no effect [-Werror,-Wignored-qualifiers]
const float operator[](uint32_t i) const;
^~
Include/NsMath/Vector.h:106:5: error: 'const' type qualifier on return type has no effect [-Werror,-Wignored-qualifiers]
const float operator[](uint32_t i) const;
^~
Include/NsMath/Vector.h:176:5: error: 'const' type qualifier on return type has no effect [-Werror,-Wignored-qualifiers]
const float operator[](uint32_t i) const;
^~

Similar in NsMath/Vector.inl:

Include/NsMath/Vector.inl:33:8: error: 'const' type qualifier on return type has no effect [-Werror,-Wignored-qualifiers]
inline const float Vector2::operator[](uint32_t i) const
^~
Include/NsMath/Vector.inl:238:8: error: 'const' type qualifier on return type has no effect [-Werror,-Wignored-qualifiers]
inline const float Vector3::operator[](uint32_t i) const
^~
Include/NsMath/Vector.inl:452:8: error: 'const' type qualifier on return type has no effect [-Werror,-Wignored-qualifiers]
inline const float Vector4::operator[](uint32_t i) const
^~

The above output is when building with version 3.0, but I did a quick check and looks like 3.1 headers still look the same, so I am setting the version to 3.1.

This issue is espacially annoying when building with -Werror.
Of course, we can work around it by disabling the warning before including these, but this requires also disabling it anywhere where the files are included indirectly via other noesis SDK headers.

Steps To Reproduce

I don't have very easy steps to reproduce but the warning should be pretty clear as to what's wrong.
But the general idea should be:

  1. Set up a C++ project, set to cpmile with clang 10, and enable -Wignored-qualifiers (and optionally -Werror) compiler flags.
  2. Include NsMath/Vector.h or Vector.inl in any file that builds with these warning flags enabled.
  3. Compile.

Potentially this can be reproduced with older clang versions as well, but I cannot currently test this.

PlatformAny

Activities

jsantos

jsantos

2021-10-27 18:54

manager   ~0007546

Thanks for this, it will be fixed

jsantos

jsantos

2021-11-23 17:00

manager   ~0007605

Fixed in r10930

Thank you!

Issue History

Date Modified Username Field Change
2021-10-27 17:04 pdx_lysannschlegel New Issue
2021-10-27 18:20 sfernandez Assigned To => jsantos
2021-10-27 18:20 sfernandez Status new => assigned
2021-10-27 18:20 sfernandez Target Version => 3.1.2
2021-10-27 18:54 jsantos Note Added: 0007546
2021-11-23 17:00 jsantos Note Added: 0007605
2021-11-23 17:00 jsantos Status assigned => resolved
2021-11-23 17:00 jsantos Resolution open => fixed
2021-11-23 17:00 jsantos Fixed in Version => 3.1.2