On 15 Apr 07, at 21:14, Tom Verhoeff wrote: > On Sat, Apr 14, 2007 at 06:56:12PM +0200, Jonas Maebe wrote: > > On 13 Apr 2007, at 17:38, Tom Verhoeff wrote: > > > > >The order -Sa -Sg- fails to generate assertion checking code, whereas > > >this is generated for the order -Sg- -Sa. > > > > > >A separate test confirms this (mis)behavior (see bug report: Steps To > > >Reproduce). > > > > > >Or am I missing the obvious, and is this really a feature and not a > > >bug? > > > > -S- disables all the -S options, regardless of where the second - > > appears (like -O- disables all -O options). This can indeed be > > confusing, since e.g. -Cor- turns on overflow checking, but disables > > range checking. This is indeed not consistent. Both cases work as > > designed, but the design is obviously not optimal. > > Thanks for the explanation. I think I understand what you are saying. > > In the (on-line) User's Guide, I can't find anything about the use of > a trailing - for options. Where is this documented? > > How would one disable just the goto statement, without affecting other > -S options? > > By the way, the User's Guide states that goto statements are disabled > by default. However, the reason we added the -Sg- (attempting to disable > just goto statements) was because after upgrading, suddenly programs > with goto were accepted (and we don't want that in our educational use > of Pascal). Hence, we added the option.
The default mode is -Mfpc nowadays. Modes FPC and OBJFPC don't have goto enabled by default (i.e. - Sg is required to enable it), so the docs are correct (modes TP and Delphi both have -Sg enabled for compatibility reasons). > Could it be that the default configuration file also got changed by the > update and now enables goto statements? (This would be confusing.) This seems to be the case indeed (see /fpcsrc/compiler/utils/samplecfg, /fpcsrc/compiler/utils/fpc.cft, /fpcsrc/compiler/utils/fpinc.cfg and /fpcsrc/installer/install.dat). General question - do we want to change this (taking into account that having some default in the compiler and then changing it into something different in the default configuration file looks strange)? If nothing else, you can obviously change this in your own configuration files, of course. Tomas _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal