Free42 state file switching, export, and import
08-18-2019, 09:43 AM
Post: #8
 SammysHP Member Posts: 152 Joined: Jul 2018
RE: Free42 state file switching, export, and import
Hi Thomas,

Wow, that are many changes to the source! That must have been a lot of time that you invested in such a "small" feature and everything for free and open source! Thank you!

Here are a few remarks after compiling Free42 under Arch Linux:

1. Arch Linux requires the X11 library as well (LIBS += -lX11). Probably all Linux distributions require it.
2. At least under Arch Linux -Wno-narrowing is necessary. As you've added it to the FreeBSD and SunOS builds, can you please add it to the normal Linux build as well? I think there are no downsides.
3. Speaking of compile options: Adding -Wno-missing-braces -Wno-unused-but-set-variable -Wno-unused-variable removes hundreds of warnings.
4. The buffer for the path generation in gtk/shell_main.cc is too small:
Code:
shell_main.cc:384:57: warning: '%s' directive output may be truncated writing up to 255 bytes into a region of size between 0 and 255 [-Wformat-truncation=]   384 |         snprintf(core_state_file_name, FILENAMELEN, "%s/%s.f42", free42dirname, state.coreName);       |                                                         ^~                      ~~~~~~~~~~~~~~ shell_main.cc:384:17: note: 'snprintf' output between 6 and 516 bytes into a destination of size 256   384 |         snprintf(core_state_file_name, FILENAMELEN, "%s/%s.f42", free42dirname, state.coreName);       |         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~​~~~~~~~~~~~~
You are trying to put two strings with a length of up to 255 characters in a buffer of only 255 characters. There are several places with this issue.
5. There are some misleading-indentation warnings like
Code:
core_keydown.cc: In function 'void keydown_normal_mode(int, int)': core_keydown.cc:1821:18: warning: this 'if' clause does not guard... [-Wmisleading-indentation]  1821 |             else if (prgms[current_prgm].text[pc] != CMD_END)       |                  ^~ core_keydown.cc:1823:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'  1823 |                 prgm_highlight_row = 1;       |                 ^~~~~~~~~~~~~~~~~~
 « Next Oldest | Next Newest »

 Messages In This Thread Free42 state file switching, export, and import - Thomas Okken - 08-14-2019, 10:03 PM RE: Free42 state file switching, export, and import - Vincent Weber - 08-14-2019, 10:52 PM RE: Free42 state file switching, export, and import - SammysHP - 08-15-2019, 04:37 AM RE: Free42 state file switching, export, and import - Vincent Weber - 08-15-2019, 03:15 PM RE: Free42 state file switching, export, and import - Thomas Okken - 08-15-2019, 03:49 PM RE: Free42 state file switching, export, and import - Vincent Weber - 08-15-2019, 04:45 PM RE: Free42 state file switching, export, and import - Thomas Okken - 08-17-2019, 08:07 PM RE: Free42 state file switching, export, and import - SammysHP - 08-18-2019 09:43 AM RE: Free42 state file switching, export, and import - Thomas Okken - 08-18-2019, 11:37 AM RE: Free42 state file switching, export, and import - ijabbott - 08-18-2019, 11:53 AM RE: Free42 state file switching, export, and import - Thomas Okken - 08-18-2019, 12:03 PM RE: Free42 state file switching, export, and import - SammysHP - 08-18-2019, 12:45 PM RE: Free42 state file switching, export, and import - Thomas Okken - 08-18-2019, 02:57 PM RE: Free42 state file switching, export, and import - Thomas Okken - 08-18-2019, 04:29 PM RE: Free42 state file switching, export, and import - Thomas Okken - 08-20-2019, 11:22 AM RE: Free42 state file switching, export, and import - Thomas Okken - 08-21-2019, 11:31 PM RE: Free42 state file switching, export, and import - Thomas Okken - 08-22-2019, 02:25 PM RE: Free42 state file switching, export, and import - Vincent Weber - 08-22-2019, 03:14 PM

User(s) browsing this thread: 1 Guest(s)