Always get warning when use glm::

#1

I don’t know it’s bug or not, but it bothered me especially while compiling it fill up the screen with all those warnings. How to fixed it or at least hide it?

full message.

In file included from /home/noorwach/Build/of/libs/glm/include/glm/./gtc/packing.hpp:579,
                 from /home/noorwach/Build/of/libs/glm/include/glm/ext.hpp:48,
                 from /home/noorwach/Build/of/libs/openFrameworks/math/ofVectorMath.h:21,
                 from /home/noorwach/Build/of/libs/openFrameworks/ofMain.h:37,
                 from /home/noorwach/Build/of/apps/of/hexa_/src/ofApp.h:3,
                 from /home/noorwach/Build/of/apps/of/hexa_/src/ofApp.cpp:1:
/home/noorwach/Build/of/libs/glm/include/glm/./gtc/packing.inl: In function ‘glm::vec2 glm::unpackUnorm2x8(glm::uint16)’:
/home/noorwach/Build/of/libs/glm/include/glm/./gtc/packing.inl:377:37: warning: ‘void* memcpy(void*, const void*, size_t)’ copying an object of non-trivial type ‘glm::u8vec2’ {aka ‘struct glm::tvec2<unsigned char, (glm::precision)0>’} from an array of ‘glm::uint16’ {aka ‘short unsigned int’} [-Wclass-memaccess]
   memcpy(&Unpack, &p, sizeof(Unpack));
                                     ^
In file included from /home/noorwach/Build/of/libs/glm/include/glm/vec2.hpp:6,
                 from /home/noorwach/Build/of/libs/openFrameworks/events/ofEvents.h:8,
                 from /home/noorwach/Build/of/libs/openFrameworks/utils/ofURLFileLoader.h:3,
                 from /home/noorwach/Build/of/libs/openFrameworks/ofMain.h:11,
                 from /home/noorwach/Build/of/apps/of/hexa_/src/ofApp.h:3,
                 from /home/noorwach/Build/of/apps/of/hexa_/src/ofApp.cpp:1:
/home/noorwach/Build/of/libs/glm/include/glm/detail/type_vec2.hpp:19:9: note: ‘glm::u8vec2’ {aka ‘struct glm::tvec2<unsigned char, (glm::precision)0>’} declared here
  struct tvec2
         ^~~~~
In file included from /home/noorwach/Build/of/libs/glm/include/glm/./gtc/packing.hpp:579,
                 from /home/noorwach/Build/of/libs/glm/include/glm/ext.hpp:48,
                 from /home/noorwach/Build/of/libs/openFrameworks/math/ofVectorMath.h:21,
                 from /home/noorwach/Build/of/libs/openFrameworks/ofMain.h:37,
                 from /home/noorwach/Build/of/apps/of/hexa_/src/ofApp.h:3,
                 from /home/noorwach/Build/of/apps/of/hexa_/src/ofApp.cpp:1:
/home/noorwach/Build/of/libs/glm/include/glm/./gtc/packing.inl: In function ‘glm::vec2 glm::unpackSnorm2x8(glm::uint16)’:
/home/noorwach/Build/of/libs/glm/include/glm/./gtc/packing.inl:409:37: warning: ‘void* memcpy(void*, const void*, size_t)’ copying an object of non-trivial type ‘glm::i8vec2’ {aka ‘struct glm::tvec2<signed char, (glm::precision)0>’} from an array of ‘glm::uint16’ {aka ‘short unsigned int’} [-Wclass-memaccess]
   memcpy(&Unpack, &p, sizeof(Unpack));
                                     ^
In file included from /home/noorwach/Build/of/libs/glm/include/glm/vec2.hpp:6,
                 from /home/noorwach/Build/of/libs/openFrameworks/events/ofEvents.h:8,
                 from /home/noorwach/Build/of/libs/openFrameworks/utils/ofURLFileLoader.h:3,
                 from /home/noorwach/Build/of/libs/openFrameworks/ofMain.h:11,
                 from /home/noorwach/Build/of/apps/of/hexa_/src/ofApp.h:3,
                 from /home/noorwach/Build/of/apps/of/hexa_/src/ofApp.cpp:1:
/home/noorwach/Build/of/libs/glm/include/glm/detail/type_vec2.hpp:19:9: note: ‘glm::i8vec2’ {aka ‘struct glm::tvec2<signed char, (glm::precision)0>’} declared here
  struct tvec2
         ^~~~~
In file included from /home/noorwach/Build/of/libs/glm/include/glm/./gtc/packing.hpp:579,
                 from /home/noorwach/Build/of/libs/glm/include/glm/ext.hpp:48,
                 from /home/noorwach/Build/of/libs/openFrameworks/math/ofVectorMath.h:21,
                 from /home/noorwach/Build/of/libs/openFrameworks/ofMain.h:37,
                 from /home/noorwach/Build/of/apps/of/hexa_/src/ofApp.h:3,
                 from /home/noorwach/Build/of/apps/of/hexa_/src/ofApp.cpp:1:
/home/noorwach/Build/of/libs/glm/include/glm/./gtc/packing.inl: In function ‘glm::vec4 glm::unpackUnorm4x16(glm::uint64)’:
/home/noorwach/Build/of/libs/glm/include/glm/./gtc/packing.inl:437:37: warning: ‘void* memcpy(void*, const void*, size_t)’ copying an object of non-trivial type ‘glm::u16vec4’ {aka ‘struct glm::tvec4<short unsigned int, (glm::precision)0>’} from an array of ‘glm::uint64’ {aka ‘long unsigned int’} [-Wclass-memaccess]
   memcpy(&Unpack, &p, sizeof(Unpack));
                                     ^
In file included from /home/noorwach/Build/of/libs/glm/include/glm/vec4.hpp:6,
                 from /home/noorwach/Build/of/libs/openFrameworks/math/ofVec4f.h:8,
                 from /home/noorwach/Build/of/libs/openFrameworks/math/ofVec3f.h:5,
                 from /home/noorwach/Build/of/libs/openFrameworks/types/ofPoint.h:3,
                 from /home/noorwach/Build/of/libs/openFrameworks/types/ofParameter.h:5,
                 from /home/noorwach/Build/of/libs/openFrameworks/utils/ofJson.h:4,
                 from /home/noorwach/Build/of/libs/openFrameworks/ofMain.h:21,
                 from /home/noorwach/Build/of/apps/of/hexa_/src/ofApp.h:3,
                 from /home/noorwach/Build/of/apps/of/hexa_/src/ofApp.cpp:1:
/home/noorwach/Build/of/libs/glm/include/glm/detail/type_vec4.hpp:19:9: note: ‘glm::u16vec4’ {aka ‘struct glm::tvec4<short unsigned int, (glm::precision)0>’} declared here
  struct tvec4
         ^~~~~
In file included from /home/noorwach/Build/of/libs/glm/include/glm/./gtc/packing.hpp:579,
                 from /home/noorwach/Build/of/libs/glm/include/glm/ext.hpp:48,
                 from /home/noorwach/Build/of/libs/openFrameworks/math/ofVectorMath.h:21,
                 from /home/noorwach/Build/of/libs/openFrameworks/ofMain.h:37,
                 from /home/noorwach/Build/of/apps/of/hexa_/src/ofApp.h:3,
                 from /home/noorwach/Build/of/apps/of/hexa_/src/ofApp.cpp:1:
/home/noorwach/Build/of/libs/glm/include/glm/./gtc/packing.inl: In function ‘glm::vec4 glm::unpackSnorm4x16(glm::uint64)’:
/home/noorwach/Build/of/libs/glm/include/glm/./gtc/packing.inl:469:37: warning: ‘void* memcpy(void*, const void*, size_t)’ copying an object of non-trivial type ‘glm::i16vec4’ {aka ‘struct glm::tvec4<short int, (glm::precision)0>’} from an array of ‘glm::uint64’ {aka ‘long unsigned int’} [-Wclass-memaccess]
   memcpy(&Unpack, &p, sizeof(Unpack));
                                     ^
In file included from /home/noorwach/Build/of/libs/glm/include/glm/vec4.hpp:6,
                 from /home/noorwach/Build/of/libs/openFrameworks/math/ofVec4f.h:8,
                 from /home/noorwach/Build/of/libs/openFrameworks/math/ofVec3f.h:5,
                 from /home/noorwach/Build/of/libs/openFrameworks/types/ofPoint.h:3,
                 from /home/noorwach/Build/of/libs/openFrameworks/types/ofParameter.h:5,
                 from /home/noorwach/Build/of/libs/openFrameworks/utils/ofJson.h:4,
                 from /home/noorwach/Build/of/libs/openFrameworks/ofMain.h:21,
                 from /home/noorwach/Build/of/apps/of/hexa_/src/ofApp.h:3,
                 from /home/noorwach/Build/of/apps/of/hexa_/src/ofApp.cpp:1:
/home/noorwach/Build/of/libs/glm/include/glm/detail/type_vec4.hpp:19:9: note: ‘glm::i16vec4’ {aka ‘struct glm::tvec4<short int, (glm::precision)0>’} declared here
  struct tvec4
         ^~~~~
In file included from /home/noorwach/Build/of/libs/glm/include/glm/./gtc/packing.hpp:579,
                 from /home/noorwach/Build/of/libs/glm/include/glm/ext.hpp:48,
                 from /home/noorwach/Build/of/libs/openFrameworks/math/ofVectorMath.h:21,
                 from /home/noorwach/Build/of/libs/openFrameworks/ofMain.h:37,
                 from /home/noorwach/Build/of/apps/of/hexa_/src/ofApp.h:3,
                 from /home/noorwach/Build/of/apps/of/hexa_/src/ofApp.cpp:1:
/home/noorwach/Build/of/libs/glm/include/glm/./gtc/packing.inl: In function ‘glm::vec4 glm::unpackHalf4x16(glm::uint64)’:
/home/noorwach/Build/of/libs/glm/include/glm/./gtc/packing.inl:505:37: warning: ‘void* memcpy(void*, const void*, size_t)’ copying an object of non-trivial type ‘glm::i16vec4’ {aka ‘struct glm::tvec4<short int, (glm::precision)0>’} from an array of ‘glm::uint64’ {aka ‘long unsigned int’} [-Wclass-memaccess]
   memcpy(&Unpack, &v, sizeof(Unpack));
                                     ^
In file included from /home/noorwach/Build/of/libs/glm/include/glm/vec4.hpp:6,
                 from /home/noorwach/Build/of/libs/openFrameworks/math/ofVec4f.h:8,
                 from /home/noorwach/Build/of/libs/openFrameworks/math/ofVec3f.h:5,
                 from /home/noorwach/Build/of/libs/openFrameworks/types/ofPoint.h:3,
                 from /home/noorwach/Build/of/libs/openFrameworks/types/ofParameter.h:5,
                 from /home/noorwach/Build/of/libs/openFrameworks/utils/ofJson.h:4,
                 from /home/noorwach/Build/of/libs/openFrameworks/ofMain.h:21,
                 from /home/noorwach/Build/of/apps/of/hexa_/src/ofApp.h:3,
                 from /home/noorwach/Build/of/apps/of/hexa_/src/ofApp.cpp:1:
/home/noorwach/Build/of/libs/glm/include/glm/detail/type_vec4.hpp:19:9: note: ‘glm::i16vec4’ {aka ‘struct glm::tvec4<short int, (glm::precision)0>’} declared here
  struct tvec4

OF v 0.10.1 gcc6 (from OF download page)
OS ubuntu 19.04 x64

#2

Hello,

Using branch 0.9.9 of glm solves the problem. I know there is some undergoing work to integrate it in OF.
It should work with the nightly.

1 Like
#4

Thank you! Oxillo.

#5

Unfortunately,it seems that the nightly is broken…

To use latest version of glm, I think you can just download it and replace the version in your openframeworks/libs folder.

On release 0.10.1, you will have to make 2 small changes.

See
https://github.com/openframeworks/openFrameworks/commit/5fa86b5ca63119e8ae239208bcf7ff67069c48a4

For the lines to change/add

#6

After I updated glm to 0.9.9.5 the 3d classes and functions are not working anymore ig ofDrawSphere(). is that just happening to me or you are?

#7

I had it too.
I deleted all the compilation files of OF lib compilation and compiled everything again.
Then it worked…
However, I’m on MSYS2 so it may be different on Linux.

#8

Cool, thanks again.