Comments (3)
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.
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.
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)
- Selected Fl_Menu_Item's are not drawn with selection color background under Windows HOT 8
- Cannot build project with CMake (add_library cannot create ALIAS target "fltk" because target "fltk::fltk" is imported but not globally visible) HOT 7
- Fl_Tree handler might refer to a null root causing a crash HOT 4
- Fl_Tree doesn't use system colors HOT 23
- Wayland: subwindow redraw issues from timeouts with NVidia driver HOT 26
- needing the set of C++ root or top classes of FLTK 1.4 HOT 4
- fltk.org is down HOT 4
- Bug in callbacks generated by fluid on macOS using system menu bar inside C++ Classes HOT 22
- Discrepant behaviour between Fl_Choice and Fl_Input_Choice HOT 19
- fltk 1.4.x: Fl_Browser unexpected display of empty lines ("@." vs "") HOT 3
- Adding /Xcode to .gitignore in FLTK HOT 2
- Fl_Window::get_size_range() HOT 1
- CMake's INCLUDES adds CMAKE_PREFIX_PATH before staging area leading to problems between .H and .cxx files on API changes HOT 6
- Wayland sends wrong events after an FL_DRAG of a top window. HOT 17
- Problems when using PNG images compiling on a Mac with STANDARD ARCHITECTURE (Apple Silicon + Intel) HOT 12
- Zero-sized borderless window causes high cpu usage on windows HOT 4
- Fl::screen_work_area under Wayland does not take into account the title bar or dockbar when at the bottom HOT 1
- Child Windows under Wayland are clipped on resizing or on showing when placed partially outside the main window HOT 91
- A widget's Drag and Drop does not work when dragging an url from Chrome on Linux HOT 14
- Changing FLTK's default color pallete effects how widgets and opengl child drawings are composited on Wayland HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fltk.