[Pas2js] Ignoring the UNIT dependencies

Ralf Quint freedos.la at gmail.com
Sat Dec 26 16:21:14 CET 2020


On 12/26/2020 2:18 AM, Jean SUZINEAU wrote:
> I agree it doesn't make sense, and I don't know specifically for 
> pas2js, but  usually specifying a unit in the uses clause can have an 
> impact even if the code doesn't make any reference to the code of this 
> unit, if the unit has an initialization part.
>
> I think for example to the cthreads unit used in Linux for threads ( 
> https://www.freepascal.org/docs-html/current/rtl/cthreads/index.html 
> ), or the memory manager for memory allocation ( 
> https://www.freepascal.org/docs-html/current/prog/progsu175.html ). 
But that is the opposite of the scenario that you described.

Even if the reference is only indirect, by the initialization section of 
a used unit, you can remove it from the uses clause. Then still no code 
of that unit would be required to compile the file you are mentioned...

Ralf



-- 
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



More information about the Pas2js mailing list