Sign in Join

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

Mailing lists / fpc-pascal / 2018-12

pas2js: Compiler options as Hints in SRC files

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

serge vertie

Hi All!
I want to use modules/functions/classes (generated from Pas sources by pas2js) from JS code,
writed manually.
In this case i can have some modules/functions/classes not used from other Pas modules (and intended to be used directly from JS). But all declarations, not used in external Pas modules, are simply ignored by pas2js,
probably because of following optimization swithes: -OoRemoveNotUsedPrivates[-] : Default is enabled
-OoRemoveNotUsedDeclarations[-] : Default enabled for programs with -Jc

Is there some way to specify some Compiler hints in some PAS sources for set this optimization OFF?
E.g. something like this.
{$modeswitch $OoRemoveNotUsedDeclarations-}

Thanks.

Reply by email

Michael Van Canneyt
to serge vertie
serge vertie wrote 16 lines
Hi All! I want to use modules/functions/classes (generated from Pas sources by pas2js) from JS code, writed manually. In this case i can have some modules/functions/classes not used from other Pas modules (and intended to be used directly from JS). But all declarations, not used in external Pas modules, are simply ignored by pas2js, probably because of following optimization swithes: -OoRemoveNotUsedPrivates[-] : Default is enabled -OoRemoveNotUsedDeclarations[-] : Default enabled for programs with -Jc Is there some way to specify some Compiler hints in some PAS sources for set this optimization OFF? E.g. something like this. {$modeswitch $OoRemoveNotUsedDeclarations-}

Just use -O-, if you disable all optimizations, then the code will remain.

As a side note: Maybe better ask this question on the pas2js list.

Michael.

Reply by email