The settings should be saved to ~/Library/Application\ Support/CodeBlocks/default.conf
There should be a crash report or a warning dialog, if this config file cannot be saved on quit.
I am now back on the Mac. I see that when I open the save workspace (ABM.workspace) I have indeed managed to save the gfortran settings. I don't know how or when I achieved this. ...
I have now spent some time experimenting with changing compiler settings (e.g. editing the Toolchain executables), and trying to save the changes. I think I now know how to get repeatable behaviour.
The first thing that seems unavoidable is that C::B always crashes on exit if a workspace or project has been opened ("CodeBlocks quit unexpectedly"). I've tried all combinations that I can see in terms of saving files, saving projects, saving everything, closing all files, before exiting, but these don't make any difference. What does make a difference is Close project, or Close workspace. Either of these causes an immediate crash. As you point out, on a crash the default.conf file is not written.
The only way that I've found to get any changes written to default.conf is to start C::B, make changes to Settings, then quit without opening any project. In this case the pop-up message "The perspective has changed. Do you want to save it?" appears, and answering 'Yes' does update default.conf, since the program exits successfully. This is a good thing to know.
One consequence of the combined effect of these two behaviours is that there is never any history available - no Recent files or Recent projects (except for default.workspace). This is just a minor inconvenience.
My only question at this point regards the crash reports. Is there any point in sending this to someone who works on the Mac port, or would it just be repeating what's already known?
Cheers
Gib