Hi,
Is there any FPC command line option for writable constanst directive {$J} or {$WRITEABLECONST} ? Since I knew this directive, I always set it to {$J-} (because {$J+} is ridiculous). However, sometimes I forget to put it in to my source code. So, I'd like to put it in to a batch script that calls fpc with all the required compiler settings for all my programs. Unfortunately, I haven't found compiler option for this directive. Any help is appreciated. Thank you.
Regards,
–Mr Bee
Mailing lists / fpc-pascal / 2017-10
compiler option for $J directive
18 messages · 10 people · –
- MMr Bee 5
- SSven Barth 5
- CChristo Crause 1
- JJuha Manninen 1
- Lleledumbo 1
- MMarco van de Voort 1
- +4 more
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Am 08.10.2017 06:39 schrieb "Mr Bee via fpc-pascal" <
Show quoted text 5 lines
directive {$J} or {$WRITEABLECONST} ?
No, there is not.
Regards,
Sven
2017-10-08 9:03 GMT+02:00 Sven Barth via fpc-pascal :
Show quoted text 10 lines
There is my old feature request about it
https://bugs.freepascal.org/view.php?id=30344 :) You can monitor it.
Regards,
Michalis
Is there any FPC command line option for writable constanst directive {$J} or…
Mr Bee wrote 12 lines
Most developers are using single .inc file that contains all directives for the whole project.
You only need to remember to include this file in all units of your projects.
Regards,
Marcos Douglas
2017-10-08 9:03 GMT+02:00 Sven Barth via fpc-pascal : There is my old feature request…
There is my old feature request about it https://bugs.freepascal.org/view.php?id=30344 :) You can monitor it.
No one seems to care to implement it, so if you badly need it: sj.patch <http://free-pascal-general.1045716.n5.nabble.com/file/t111899/sj.patch> Apply in compiler directory (please checkout r37430 at least), I only svn diff there, not in the top level directory (I have modifications to certain packages).
Am 08.10.2017 22:24 schrieb "leledumbo via fpc-pascal" <
Show quoted text 9 lines
certain
packages).
Applied in r37437. Thank you for the patch.
Regards,
Sven
Thank you, both to Leledumbo and Sven. Will this patch be available in the next FPC v.3.0.4 release?
–Mr Bee
Pada Selasa, 10 Oktober 2017 04.44.44 WIB, Sven Barth via fpc-pascal menulis:
"leledumbo wrote 10 lines
Applied in r37437. Thank you for the patch.
Regards,
Sven
On Sun, Oct 8, 2017 at 1:38 AM, Mr Bee via fpc-pascal Most developers are using single…
2017-10-08 23:17 GMT+07:00 Marcos Douglas B. Santos :
Most developers are using single .inc file that contains all directives for the whole project.
Well, I don't like such approach. I prefer using my own shell script that I can configure for many purposes and conditions such as build release, build debug, build test, build deploy, etc. which each has different compiler setting with custom before/after action.
Thank you, both to Leledumbo and Sven. Will this patch be available in the next FPC…
In our previous episode, Mr Bee via fpc-pascal said:
Thank you, both to Leledumbo and Sven. Will this patch be available in the next FPC v.3.0.4 release?
Since it is already largely uploaded, no. We are only waiting on some targets.
No one seems to care to implement it, so if you badly need it: sj.patch…
leledumbo wrote 9 lines
Now a patch has been integrated for this , perhaps it could be added to Lazarus Project Options | Compiler Options | Parsing
BTW why would anyone want
{$WRITEABLECONST ON}writable constants is an oxymoron and goes against the whole philosophy of strict types which is central to Pascal.
:?
Now a patch has been integrated for this , perhaps it could be added to Lazarus Project Options | Compiler Options | Parsing
Patches are welcome also for that.
The option must be either hidden for compiler versions that do not support it, or there must be a clear note / hint about it.
Juha
BTW why would anyone want {$WRITEABLECONST ON} writable constants is an oxymoron and goes against the whole philosophy
of strict types which is central to Pascal.
They were used mainly back at TP times to have procedure local static variables (cause that is how they behave as inside procedures).
Regards,
Sven
In our previous episode, Mr Bee via fpc-pascal said: Since it is already largely…
2017-10-10 13:28 GMT+07:00 Marco van de Voort :
Since it is already largely uploaded, no. We are only waiting on some targets.
I thought such a minor fix that don't break any codes could be included.
of strict types which is central to Pascal. They were used mainly back at TP times to…
2017-10-10 16:21 GMT+07:00 Sven Barth via fpc-pascal <
Show quoted text 5 lines
Can we make the {$J-} as default in fpc and objfpc mode for the next major release?
> They were used mainly back at TP times to have procedure local static
variables (cause that is how they behave as inside procedures).
Can we make the {$J-} as default in fpc and objfpc mode for the next
major release?
+1
2017-10-10 16:21 GMT+07:00 Sven Barth via fpc-pascal < Can we make the {$J-} as default…
Am 11.10.2017 07:00 schrieb "Mr Bee via fpc-pascal" <
Show quoted text 6 lines
variables (cause that is how they behave as inside procedures).
Can we make the {$J-} as default in fpc and objfpc mode for the next
major release?
The default of $J will change in *no* existing mode as that will break backwards compatibility. It doesn't matter whether it's a major release or not.
Regards,
Sven
2017-10-10 13:28 GMT+07:00 Marco van de Voort : I thought such a minor fix that don't…
Am 11.10.2017 05:12 schrieb "Mr Bee via fpc-pascal" <
Show quoted text 10 lines
It doesn't matter whether it's minor. Building has already started and we definitely won't start that again for something like this.
Regards,
Sven
of strict types which is central to Pascal. They were used mainly back at TP times to…
Sven Barth wrote 9 lines
Just adding to what has been mentioned previously - they were the only possibility for variables initialized at compile time at that time. That's how mode FPC started as well - possilibity of specifying the initial value for a "var" was added much much later.
Tomas
