Giter Club home page Giter Club logo

Comments (6)

guillaumeblanc avatar guillaumeblanc commented on July 3, 2024

Hi,

thanks for reporting the issue. Here's the original implementation for reference.

I'd have a few questions:

  • Is this a warning, or an error?
  • Could you give more details about the callstack? This is a macro, so the issue could be on the caller side.
  • What version of gcc are you using? Could you repro it on the linux CI?

The important thing for me is to understand if there is really an error, in which case it needs to be fixed. Your implementation is also accessing a and b, so I don't see how it fixes the error. What do you think?

Cheers,
Guillaume

from ozz-animation.

Form2 avatar Form2 commented on July 3, 2024

Here's the first error with all related lines:

inlined from ‘void ozz::io::internal::Array<_Ty>::Load(ozz::io::IArchive&, uint32_t) const [with _Ty = float]’ at .../ozz-utils/ozz-animation/include/ozz/base/io/archive.h:369:1,
inlined from ‘static void ozz::io::Extern<_Ty>::Load(ozz::io::IArchive&, _Ty*, size_t, uint32_t) [with _Ty = const ozz::io::internal::Array<float>]’ at .../ozz-utils/ozz-animation/include/ozz/base/io/archive.h:280:18,
inlined from ‘void ozz::io::IArchive::operator>>(_Ty&) [with _Ty = const ozz::io::internal::Array<float>]’ at .../ozz-utils/ozz-animation/include/ozz/base/io/archive.h:198:22,
inlined from ‘static void ozz::io::Extern<ozz::math::Float4>::Load(ozz::io::IArchive&, ozz::math::Float4*, size_t, uint32_t)’ at .../ozz-utils/ozz-animation/src/base/maths/math_archive.cc:68:12:

.../ozz-utils/ozz-animation/include/ozz/base/endianness.h:73:10: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
73 | (_b) = temp;
| ~~~~~^~~~~~
.../ozz-utils/ozz-animation/include/ozz/base/endianness.h:106:7: note: in expansion of macro ‘OZZ_BYTE_SWAP’
106 | OZZ_BYTE_SWAP(alias[i + 1], alias[i + 2]);
| ^~~~~~~~~~~~~
In file included from .../ozz-utils/ozz-animation/include/ozz/base/maths/box.h:33,
from .../ozz-utils/ozz-animation/src/base/maths/math_archive.cc:33:
.../ozz-utils/ozz-animation/include/ozz/base/maths/vec_float.h: In static member function ‘static void ozz::io::Externozz::math::Float4::Load(ozz::io::IArchive&, ozz::math::Float4*, size_t, uint32_t)’:
.../ozz-utils/ozz-animation/include/ozz/base/maths/vec_float.h:100:9: note: at offset 26 into destination object ‘ozz::math::Float4::x’ of size 4

gcc --version shows:

gcc (Ubuntu 11.2.0-7ubuntu2) 11.2.0

Your question:

"Could you repro it on the linux CI?"

I'm not sure... I don't use github in a collaborative manner very often... So I'm afraid that you've gone over my head...

Your concern:

"The important thing for me is to understand if there is really an error"

I think that you are probably right to be suspicious... This is probably the compiler being annoying...
I hope that opening this as an issue was helpful, but I'm afraid that it was not :)

from ozz-animation.

guillaumeblanc avatar guillaumeblanc commented on July 3, 2024

Hi,

yes for sure opening the issue is helpful, others might experience the same issue indeed.

I could repro the compiling issue with the CI, using a gcc 11 release build.

The serialization code considers x,y,... components as contiguous floats in memory, aiming to serialize them at once. My understanding is that the compiler considers them as different float members, hence generates an error when writing further than x.

I think the code is ok, but I understand the error. I need to dig further to see what can be done.
Don't hesitate if you have an idea or a different analysis.

Thanks,
Guillaume

from ozz-animation.

Form2 avatar Form2 commented on July 3, 2024

For what it's worth, I've been using the fix I first mentioned without problems. Glad I could help, and thanks for the reply.

from ozz-animation.

KevinLium avatar KevinLium commented on July 3, 2024

mark ,thanks

from ozz-animation.

guillaumeblanc avatar guillaumeblanc commented on July 3, 2024

Suggested fix committed.

from ozz-animation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.