warnings compiling 1.3.8

11 views
Skip to first unread message

HASM

unread,
Mar 3, 2023, 1:58:00 PM3/3/23
to fltkg...@googlegroups.com
I fixed (or tried to fix) a bunch of warnings compiling 1.3.8 forked from master on github and submitted a pull request.

There is one warning I can't really fix without some redesigning of the code.

In line 33 of fluid.cxx, undo_filename function, there is this snprintf call:

snprintf(buf, bufsize, "%sundo_%d_%d.fl", undo_path, getpid(), level);

where undo_path is of dimension FL_PATH_MAX and bufsize is an input to the function, that most if not all of the time, is also of dimension FL_PATH_MAX.

The "n" in snprintf should protect the printf from writing beyond the end of the array, but if the string in undo_path is of length FL_PATH_MAX (well, close to it), there is no space left in buf to append "undo_<pid>_<level>.fl" to it.

No idea what the code is doing, probably providing undoing capability to something, but it that (unlikely?) case it may not work as intended.

-- Henrique


Message has been deleted

albrech...@gmail.com

unread,
Mar 4, 2023, 5:52:44 AM3/4/23
to fltk.general
On Friday, March 3, 2023 at 7:58:00 PM UTC+1 HASM wrote:
I fixed (or tried to fix) a bunch of warnings compiling 1.3.8 forked from master on github and submitted a pull request.

Thank you for doing this, but 1.3.x is really at the end of its lifetime. We're now working on the release of 1.4.0 (GitHub 'master' branch) and you may find that much of the code has been changed and compiler warnings that exist in 1.3.x have already been fixed (or maybe not).

Besides working for 1.4.0 I'm preparing a final 1.3.x release (1.3.9) with some important fixes, but esoteric compiler warnings (those that are not seen by using "standard" compiler switches) will not be fixed in the 1.3.x series.

OTOH, fixing compiler warnings in the 'master' branch is always appreciated, but if you do so (and maybe open a Pull Request), please make sure that you also document which compiler version and commandline switches you were using so we can reproduce the issue and then fix it.
Reply all
Reply to author
Forward
0 new messages