Giter VIP home page Giter VIP logo

Comments (6)

jube avatar jube commented on August 23, 2024

I think size_t is the same as unsigned on this architecture. Not easy to fix.

from gf.

Popolon avatar Popolon commented on August 23, 2024

Is there a test that I can made to confirm this ? I use ARMv7 (32 bits), I know that for example, default float format is float not double in QT tool-kit on this platform, and double on x86 and ARMv8 (64 bits).

This can be tested like with this on linux, for both ARM 32bit (v5/v6/v7 I suppose) and ARM 64bit (found in libjpeg-turbo), probably a test for each case is better here. I could at least provide some test/debug on ARMv7, and very probably soon on ARMv8

#if defined GNUC && (defined arm || defined aarch64)

There is some explanation about difference in types on both platforms here:
http://malideveloper.arm.com/downloads/ARMv8_64_bit_migration.pdf

from gf.

jube avatar jube commented on August 23, 2024

You can try to compile something like:

#include <iostream>
#include <type_traits>

int main() {
  std::cout << std::boolalpha;
  std::cout << std::is_same<unsigned, std::size_t>::value << '\n';
  return 0;
}

Compile with gcc -std=c++11 file.cc. If it prints true, then it's the same type.

I see two possible solutions for this bug:

  • easy: remove the explicit instantiation for std::size_t (same for Vector, Rect, etc)
  • difficult: make a check at build time with CheckTypeSize

I do not really like the preprocessor condition based on architecture because this error may happen on other architectures.

from gf.

Popolon avatar Popolon commented on August 23, 2024

Answered true. So that's the problem :(.

I didn't coded in C++ since long time and discover lot of evolutions since last time.

from gf.

Popolon avatar Popolon commented on August 23, 2024

gcc -o test_validation2 -std=c++11 -lstdc++ test_validation.cpp
I needed to type this to compile it, using or not -std=c++11 give the same result.

from gf.

jube avatar jube commented on August 23, 2024

OK. So I will remove the explicit instantiations with std::size_t. Anyway, they are not used in the library. Will come in the next push.

from gf.

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.