Code Monkey home page Code Monkey logo

Comments (3)

Albrecht-S avatar Albrecht-S commented on August 19, 2024 1

Thanks for the feedback. I could now reproduce it building with CMake under Linux using a "Release" build type. The warning does not appear with "Debug" builds (too lazy to compare compiler flags).
FTR:

$ gcc --version
gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
$ cmake -DCMAKE_BUILD_TYPE=Release -GNinja ../..
[...]
Building CXX object src/CMakeFiles/fltk.dir/Fl_Table_Row.cxx.o
In function ‘void Fl_Table_Row::CharVector::size(int)’,
    inlined from ‘virtual void Fl_Table_Row::rows(int)’,
    inlined from ‘virtual void Fl_Table_Row::clear()’ at ../../FL/Fl_Table_Row.H:181:9:
../../src/Fl_Table_Row.cxx:56:25: warning: argument 2 range [18446744071562067969, 18446744073709551615] exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
     arr = (char*)realloc(arr, count * sizeof(char));
                  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from /usr/include/c++/7/stdlib.h:36,
                 from ../../FL/fl_utf8.h:36,
                 from ../../FL/Fl.H:33,
                 from ../../FL/Fl_Widget.H:26,
                 from ../../FL/Fl_Group.H:25,
                 from ../../FL/Fl_Table.H:23,
                 from ../../FL/Fl_Table_Row.H:25,
                 from ../../src/Fl_Table_Row.cxx:27:
/usr/include/stdlib.h: In member function ‘virtual void Fl_Table_Row::clear()’:
/usr/include/stdlib.h:549:14: note: in a call to allocation function ‘void* realloc(void*, size_t)’ declared here
 extern void *realloc (void *__ptr, size_t __size)
              ^~~~~~~

Following the link given above I got the impression that this is a bug of gcc/libc and may be fixed in a future version but I'm going to "fix" it anyway since the suggested patch doesn't do any harm.

Thanks again.

from fltk.

Albrecht-S avatar Albrecht-S commented on August 19, 2024

Thanks for the report, the link, and the potential fix.

ISTR that I saw such a warning recently but I can't reproduce it right now. Which exact GCC version(s) exhibit this warning, and on which OS?

Please show us also your configure command line or the compiler options you're actually using. TIA.

from fltk.

iSLC avatar iSLC commented on August 19, 2024

I was using MinGW-w64 GCC 7.3 x64 (posix, seh). If I would compile the library normally that probably wouldn't show up. But I suspect that because I included the project via add_subdirectory(fltk) and my project had c++17 enabled. That option (probably) propagated to the fltk library and c++17 could have stricter rules about implicit conversions.

from fltk.

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.