FreeCalypso > hg > freecalypso-tools
view doc/opt-freecalypso-tree @ 465:003e48f8ebe1
rvinterf/etmsync/fsnew.c: cast 0 to (char *) for execl sentinel
I generally don't use NULL and use plain 0 instead, based on a "NULL
considered harmful" discussion on the classiccmp mailing list many aeons
ago (I couldn't find it, and I reason that it must have been 2005 or
earlier), but a recent complaint by a packager sent me searching, and I
found this:
https://ewontfix.com/11/
While I don't give a @#$% about "modern" systems and code-nazi tools,
I realized that passing a plain 0 as a pointer sentinel in execl is wrong
because it will break on systems where pointers are longer than the plain
int type. Again, I don't give a @#$% about the abomination of x86_64 and
the like, but if anyone ever manages to port my code to something like a
PDP-11 (16-bit int, 32-bit long and pointers), then passing a plain 0
as a function argument where a pointer is expected most definitely won't
work: if the most natural stack slot and SP alignment unit is 16 bits,
fitting an int, with longs and pointers taking up two such slots, then
the call stack will be totally wrong with a plain 0 passed for a pointer.
Casting the 0 to (char *) ought to be the most kosher solution for the
most retro systems possible.
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 11 Feb 2019 00:00:19 +0000 |
parents | 0a01e1c4ea54 |
children | 519689d3e1c7 |
line wrap: on
line source
The /opt/freecalypso host directory tree used by the present FC host tools package and by various add-ons to it does NOT follow the traditional Unix/Linux file system hierarchy standard (FHS), instead it is a highly specialized directory tree that is meant to be private to FreeCalypso, with its structure defined solely by the Mother and no one else. The following subdirectories are currently defined: aud-*: these directories appear if you install our optional fc-audio-config package, and contain subtrees to be uploaded by production line scripts into target device FFS under /aud via fc-fsio. batteries and charging: these subtrees come from fc-battery-conf (optional just like fc-audio-config) and are meant to be used with fc-fsio write-battery-table and write-charging-config commands. bin and include are the only subdirectories under /opt/freecalypso which follow traditional UNIX directory layout; include was added so that packages external to the core FC host tools package like fc-rfcal-tools and freecalypso-ui-dev can use rvinterf headers. gcc: the recommend install location for our ARM7 gcc toolchain is /opt/freecalypso/gcc. helpfiles subdir contains help files for those FC host utilities which implement a help command. loadtools subdir contains hardware parameter files and init scripts which underlie the all-important -h option to fc-loadtool, fc-iram and fc-xram, collectively known as loadtools. rfcal subdir only appears if you are doing RF calibration and install fc-rfcal-tools, and some of the necessary config files under that subdir you have to create yourself using your own RF knowledge specific to your particular setup. target-bin contains ARM7 target binaries used under the hood by loadtools. The basic minimal form of the /opt/freecalypso tree is populated when you install FC host tools, but it is further enriched if and when you install further add-ons (fc-audio-config, fc-battery-conf, fc-rfcal-tools) which are more specialized and not required for all users. I expect to have more additions in the future: for example, when we start using the Melody E1 mechanism in our planned FC Libre Dumbphone, there will be a FreeCalypso ringtones package that will install E1-format melody files somewhere under /opt/freecalyso, to be subsequently uploaded into the actual phones via fc-fsio, initially at production time and optionally by end users.