Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2007-04

Re: Submitted bug report on option order -Sa -Sg-

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Tom Verhoeff

(Discussion switched from fpc-devel to fpc-pascal, because it might be of more general interest.)

Jonas Maebe wrote 17 lines
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.

Could it be that the default configuration file also got changed by the update and now enables goto statements? (This would be confusing.)

Tom

E-MAIL: T.Verhoeff @ TUE.NL | Dept. of Math. & Comp. Science PHONE: +31 40 247 41 25 | Technische Universiteit Eindhoven FAX: +31 40 247 54 04 | PO Box 513, NL-5600 MB Eindhoven http://www.win.tue.nl/~wstomv/ | The Netherlands

Reply by email

Tomas Hajny
to Tom Verhoeff
Tom Verhoeff wrote 31 lines
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

Reply by email