Michael Van Canneyt wrote:
On Fri, 25 Jul 2014, Juha Manninen wrote:

I was asked why a threaded application compiles on Linux without "uses
cthreads" but it does not work.
cthreads must _always_ be added to uses section.
I had no answer to that. IMO such errors should be trapped at
compile-time, not at run-time.
Could it be fixed somehow?

No, because there is no way to detect that threads are actually used in the program.

I will add a remark in the classes unit TThread class documentation, to make it even more obvious.

Is there scope for improving the error message?

Is there a scenario in which a program that sometimes uses threads (e.g. if it realises it's being asked to do a big job which can be parallelised) could start without giving the error message? This would make the situation more serious, since it would require that the programmer did some /real/ testing before shipping his code :-)

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to