Kevin Day [Wed, 22 Apr 2026 03:47:00 +0000 (22:47 -0500)]
Bugfix: The bootstrap script is overwriting existing multi-valued settings.
This happens when there are multiple modes specifying the same value.
The multi-valued settings must have the value appended and not overwritten or removed.
Specifically, the setting is designated as not populated when a mode specifies a setting and then is followed by another mode that does not specify this setting.
Resolve this by adding checks if the setting is already designated as specified.
If the settings is not specified, then and only then declare it as unspecified.
Kevin Day [Wed, 22 Apr 2026 03:20:18 +0000 (22:20 -0500)]
Bugfix: The bootstrap script improperly loads settings resulting in incorrectly failed builds.
I suspect this situation happened due to various changes over time without a thorough review of everything that needs to be changed.
Reserve the variable index position of 0 to designate not found.
Update all checks to then check for `key` to not be 0 after calling `bootstrap_id()`.
This fixes problems where the position after the last valid index might get set and used as a value.
When the position after the last valid index is read, it could read these values even if it should report not found.
The index position checks are updated to more properly check and assign the index using the appropraite `has-*` and `has-*-mode` vs the normal value `*` and `*-mode`, respectively.
Update all index position checks to check the `has-*` and `has-*-mode` accordingly.
This change fixes the primary problem that is causing the build to fail due to incorrect variable loading.
The `has-*` and `has-*-mode` checks checks for existence.
Then and only then should the actual respective values be used.
In particular, the `*-mode` settings should only be assigned if the respective `has-*-mode` is set to `yes`.
This bug is observed in my **TKIS** script development where the `path_headers` is being treated as an empty string despite being designated as `fll`.
The **Featureless Make** program compiles properly but not this `bootstrap.sh` script.
The **TKIS** scripts are expected to be run on a system without the **FLL** project at all.
I have not observed this problem because I have been using the **Featureless Make** directly for years now.
The packaging and unit tests scripts provided by this project are coincidentally not triggering any obvious errors with the improper behavior.
If the existing scripts were working before then these changes might cause problems with those scripts.
I will follow this up and investigate and fix these issues.
Running the **Featureless Make** on these works and so these changes likely expose existing problems rather than causes regressions.
I would love to find a way to reduce the repetitive assignments to variables in a safe/sane manner.
This would require more research on my part, if it is even possible.
I don't plan on doing such research any time soon and so I am continuing to consider the bootstrap script design as tolerable.
Additional Changes:
- Simplify logic in for loops for `bootstrap_id()` by combining all of the passes into a single pass (The actual index values are irrelevant and so restructuring/reordering caused by this is not a problem).
- Ensure the key is an integer in all cases.
- Remove unnecessary `key` variable assignments.
- Remove some redundant assignments.
Kevin Day [Tue, 21 Apr 2026 02:05:07 +0000 (21:05 -0500)]
Bugfix: Out of place build settings files in stand alone builds.
The regular files are being included in the stand alone builds.
This is confusing and can lead to build failures due to selecting invalid build settings files.
Remove the build settings files that must not exist in stand alone builds.
Kevin Day [Wed, 4 Mar 2026 04:41:14 +0000 (22:41 -0600)]
Bugfix: Invalid seeked value on failure in f_file_seek().
The `lseek()` can return a negative value.
Use a local variable to get the `lseek()` value.
This then allows for the `seeked` to be NULL.
Change the `seeked` parameter to be optional and when set to NULL then it is not assigned.
This neither breaks API nor ABI.
The `seeked` value is only assigned when the result is `-1`.
The POSIX standard is inconsistent about negative return values.
In the case of `lseek()`, only `-1` is technically an error.
Kevin Day [Wed, 28 Jan 2026 05:44:03 +0000 (23:44 -0600)]
Bugfix: Invalid IPv6 addressdetection and improve IPv4 address detection in f_network_is_ip_address().
The `f_network_is_ip_address()` is not properly identifying bracketed IPv6 addresses.
Digits to the left of double colons `::` should be supported.
The forward slash `/` should be allowed after double colons `::`.
Ending in a double colon `::` is in fact valid in situations, such as with `::/0`.
Make the IPv6 logic easier to follow by adding additional comments.
Also rename `count` to `digits` to further make the code logic more understandable.
Improve IPv4 detection by checking if the number is between 0 and 255, inclusively.
Add more unit tests to better catch the newly identified and now resolved problems.
Update unit tests to use the newer `macro_f_string_static_t_initialize_2()` instead of `macro_f_string_static_t_initialize_1()`.
Add additional comments to help identify rows.
Kevin Day [Tue, 13 Jan 2026 02:11:04 +0000 (20:11 -0600)]
Feature: Add support for debug mode in test script.
The test script should also support the debug mode.
This is not to be confused with running the build process in debug mode itself (the `+D` / `++debug` setting).
Kevin Day [Mon, 12 Jan 2026 02:47:31 +0000 (20:47 -0600)]
Bugfix: Static builds with '../' relative paths for objects do not build correctly.
Add new function that handles converting the relative path with '../' with one that has no '../'.
Use this to build the object paths by adding the full relative directory path for the build files.
Note that this could be a problem with possible directory structure conflicts in some situations.
Utilize a new cache `cache_relative` for the processing of the relative path.
Add additional debug reporting to improve the error reporting details with the programs, like `ar`, fail.
Add note how future FLL versions (0.9 and later) should have something like `fl_path_canonical()`.
I need to also follow this commit up with an investigation to see if any of these `../` can get outside the project root.
There is a need for a project root parameter for situations where different paths are specified, such as specifying `--sources`.
Alternatively, I might have to restrict all `../` to the sources directory and then move all of my `tests/` directory files within the `sources/` directoreis for all projects.
This also gives me reason to consider adding IKI support to enhance the build settings.
I am on the fence on actually doing this or not.
Kevin Day [Sun, 11 Jan 2026 22:26:48 +0000 (16:26 -0600)]
Bugfix: The fl_path_canonical() is not consistently resetting canonical.used.
The `fl_path_canonical()` is replacing the `canonical` variable rather than appending to it.
However, when `path.used` is 0, then the current path is appended without resetting `canonical.used` to 0.
Ensure that `canonical.used` is always set to 0 to enforce replacement.
Add explicit documentation comment making it clear that this function performs a replacement rather than an append.
Kevin Day [Sun, 11 Jan 2026 02:26:32 +0000 (20:26 -0600)]
Bugfix: Actually install man files.
I setup the man files to be used along with the `0.8.0` release.
I completely forgot to actual add the configuration to move the man files into the proper location so that they can be installed.
Add the appropriate build settings that designate the documentation file to be installed.
Kevin Day [Fri, 9 Jan 2026 01:11:49 +0000 (19:11 -0600)]
Update: Next micro version (0.8.1).
The following are the commands that I ran to make this change:
# find build/ level_? specifications/ documents/ licenses/ -type f -exec sed -i -e 's|0\.8\.0|0.8.1|g' -e 's|^version_micro 0|version_micro 1|g' '{}' ';'
# find level_3/ -name *.h -exec sed -i -e 's|_program_version_micro_s F_string_ascii_0_s|_program_version_micro_s F_string_ascii_1_s|g' -e 's|_program_version_micro_s_length F_string_ascii_0_s_length|_program_version_micro_s_length F_string_ascii_1_s_length|g' '{}' ';'
# sed -i -e 's|version_micro 0|version_micro 1|g' build/*/settings build/stand_alone/*.settings level_*/*/data/build/*settings*
Kevin Day [Fri, 19 Dec 2025 01:01:41 +0000 (19:01 -0600)]
Bugfix: Error reporting has invalid syntax and some are the wrong errors.
The Access Denied error is missing the trailing quote.
The problem appears to stem from when I added the debug printing support.
I failed to place the closing quote into the correct location.
I also noticed that the static strings array is too short!
This will result in the wrong errors being printed.
Add the missing strings.
The stand alone builds must be updated because this now uses a string that wasn't used before.
Make sure `_di_f_string_format_sentence_end_basic_s_` is available in all custom builds that rely on the error printing.
Add a convenience build mode similar to the `android` build mode for the `pinephone`.
Just like with the `android` build mode, add a parameter to build using the `pinephone` mode to the `bootstrap-example.sh` script.
Utilize the android build variables for the script, replacing them with a more generic variable name.
I discovered and addressed some build settings inconsistencies while mass adding the `pinephone` mode.
Kevin Day [Mon, 15 Dec 2025 02:38:55 +0000 (20:38 -0600)]
Update: Provide _pthread_kill_as_pthread_cancel_ and disable thread robust functions for Android builds.
The `_pthread_kill_as_pthread_cancel_` provides an experimental work-around for Android.
Android does not support the `pthread_cancel()` (not supporting this makes Android unsafe).
Use `pthread_kill()` with the terminate signal in place of `pthread_cancel()` when this is defined.
The `f_thread_cancel_state_set()` is also replaced with a stub function that returns `F_implement_not`.
Kevin Day [Mon, 15 Dec 2025 01:10:12 +0000 (19:10 -0600)]
Bugfix: Cannot disable f_thread_cancel() and f_thread_cancel_state_set() on Android.
These are now required by the programs.
I also tested on Android and found that these now work.
It should be safe to enable these by default on Android.
Kevin Day [Sun, 14 Dec 2025 20:41:02 +0000 (14:41 -0600)]
Update: Add -A option to example bootstrap script for android.
The Android system has a terrible interface.
Make the bootstrap process easier by allowing a single parameter to be passed to enable passing android build mode to everything being built.
Kevin Day [Sun, 14 Dec 2025 16:34:56 +0000 (10:34 -0600)]
Update: Add man pages forr most or all FLL functions and programs.
The man page format is terrible.
The doxygen program helps automatically create these, but it is terrible at generating the man page format (on top of the man page format itself being terrible).
I found a tool from https://github.com/gsauthof/doxy2man.git that helps convert doxygen created xml files into man pages.
It works a lot better than doxygen's man page generation.
The generation from doxygen still has problems.
It doesn't understand some of the commenting structure.
This documents the process so that I do not have to try and figure this out all over again.
I have to take the generated man pages and modify them to clean up a bunch of mess.
This is a lot of work and so I am expecting to have missed something, overlooked something, or made some silly mistake.
Oh well. I can address such problems over time.
This is another reminder (like commit 63be746d22d66870ae89f9575c82db7d0b784e32 from the 0.6 branch) that I probably have to write something that provides a better documentation format.
Then I can convert that to man pages.
I imagine something using FSS + Wiki + IKI.
Using both Wiki and IKI is because IKI isn't meant to replace Wiki.
Kevin Day [Sat, 13 Dec 2025 17:21:55 +0000 (11:21 -0600)]
Update: Build settings header ordering and config.c and config.h files.
Change the ordering to have the headers before the source files.
This seems to flow more naturally.
Move the main program and config.c files onto their own source lines, in general.
Make sure all programs have a config.c and config.h file.
I've generated these files in the past but now with the external programs it has become less consistent.
Make the files statically defined rather than generated and explicitly add them to the build settings.
The individual, level, and monolithic builds should still craete the config.h and config.c files.
However, remove the automated insertion of the config.c into the build settings files.
These are now directly added to the build settings files.
Kevin Day [Fri, 12 Dec 2025 03:08:29 +0000 (21:08 -0600)]
Update: Existing stand alone builds.
Change the file structure for the fl_fss source files, breaking it up into two lines.
The status code should use `stand_alone` as the stage.
I was originally trying something different and abandoned the approach but I forgot to change the stage back to `stand_alone`.
Kevin Day [Thu, 11 Dec 2025 05:53:29 +0000 (23:53 -0600)]
Bugfix: Multiple dependencies files, not handling all of the dependencies.
A single stand alone project is not properly getting all of the FLL sources when multiple dependency files are specified and they have different dependencies.
This now ensures that all properly named `dependencies` files are processed.
Kevin Day [Wed, 10 Dec 2025 04:23:50 +0000 (22:23 -0600)]
Refactor: Build mode gcc_13 to flex_arrays to provide a more generic name.
The `gcc_13` was a temporary mode and I don't want to have version specific modes.
Replace the mode witha more long term version unspecific name `flex_arrays`.
Kevin Day [Sun, 7 Dec 2025 22:32:48 +0000 (16:32 -0600)]
Feature: Add f_process project.
This provides pidfd functionality that I intend to utilize in future work.
Provide `f_handle_t` for represetning `struct file_handle`.
Several of the functions being represented are not in some libc implementations.
Use `syscall()` to handle these.
Provide defines for enabling/disabling the `syscall()` behavior.
Provide stubs for mocking such functions in unit tests so as to avoid trying to mock `syscall()` itself.
Kevin Day [Sat, 6 Dec 2025 21:37:23 +0000 (15:37 -0600)]
Cleanup: Reduce extra blocks in delete and destroy call backs.
Early on I was uncertain at how I should handle this.
I wanted the block design, with anticipation that there would be cases where other code might operate after the first scope ended.
This made for easy and copy and paste (as well as some level of consistency) when switching between different types.
There has been massive changes over time regarding the structure of the delete and destroy functions (which are now call backs).
Most of the blocks end right before the function ends.
Simplify the design in these cases by removing one level of block structure.
Kevin Day [Wed, 3 Dec 2025 03:32:51 +0000 (21:32 -0600)]
Feature: Add macro_*_t_intialize_3(array_value, length_value) macros for initializing static arrays.
The standard array type structures now have a `macro_*_t_intialize_3(array_value, length_value)` where `length_value` is the `used` value and the `size` is set to `0`.
This designates that the array (or string) is statically allocated (only when the memory address for `array` or `string` is non-NULL).
Kevin Day [Mon, 1 Dec 2025 01:37:23 +0000 (19:37 -0600)]
Update: Avoid the use of bool, keeping it to a bare minimum.
Use `uint8_t` to both enforce a specific byte size as well as provide the ability for it to be converted into a set of bits if need be, without breaking API or ABI.
Kevin Day [Sun, 30 Nov 2025 21:56:48 +0000 (15:56 -0600)]
Update: Make *_t_clear() functionality consistent and fix existing problems.
These were being removed at one point in time, resulting in an inconsistent declaration of these macros.
The memory clear macros were also removed, but some of the uses still (incorrectly) remained.
Ensure that these `*_t_clear()` macros are encased in a brace defined block.
Do not use semi-colons at the end of the `*_t_clear()` uses.
Do use semi-colons at the end of `*_t_clear()` direct property assignments.
Kevin Day [Sun, 30 Nov 2025 05:26:10 +0000 (23:26 -0600)]
Refactor: Relocate the order of the size and used properties for f_string_static_t and f_string_dynamic_t.
This will be performed on all types, but I started with `f_string_static_t` and `f_string_dynamic_t` given how much they are being used.
This is done to help reduce potential security problems relating to allocation and buffer overflows.
This is not expected to stop attacks or intentional mis-uses.
This is instead expected to help reduce the attack surface area by reducing the possible harm from coding or runtime mistakes.
The basic structure is:
```pseudocode
my_type {
array
used
size
}
```
If an array overflow write occurs, it is mostly likely to write in the `used` structure rather than the `size` (unless the compiler does something different).
This can cause the `used` to become corrupted rather than the `size`.
This essentially makes `used` act as a buffer to the `size` property.
While this is still a bad state, the memory allocation might still get preserved and allow for proper de-allocation without memory leaks.
Stack protection and similar security practices helps make larger overflow writes more likely to get caught and therefore more likely to be stopped before the `size` gets corrupted.
This, of course, does not protect against intentional mis-uses and abuses.
I was holding this off for some time due to the sheer size of the required changes.
However, once a code freeze happens, then I cannot make these API and ABI breaking changes.
Therefore, now is the time for me to make these changes.
Also begin using the `{ .property = value }` notation.