Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: Deprecated TIdSync in Berlin and Tokyo


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Aug 28, 2017 11:13 AM Last Post By: Remy Lebeau (Te...
Vladimir Zhuchko

Posts: 107
Registered: 1/22/98
Deprecated TIdSync in Berlin and Tokyo  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 25, 2017 4:31 AM
My rather old project produces now these messages:

[bcc32 Warning] ftp_dm.h(89): W8111 Accessing deprecated entity 'TIdSync'
[bcc32 Warning] ftp_dm.h(103): W8111 Accessing deprecated entity '_fastcall TIdSync::Synchronize()'

What can I change to avoid such warnings?
--
With best regards
Dr. Vladimir Zhuchko
Remy Lebeau (Te...


Posts: 8,940
Registered: 12/23/01
Re: Deprecated TIdSync in Berlin and Tokyo  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 28, 2017 11:13 AM   in response to: Vladimir Zhuchko in response to: Vladimir Zhuchko
Vladimir Zhuchko wrote:

My rather old project produces now these messages:

[bcc32 Warning] ftp_dm.h(89): W8111 Accessing deprecated entity
'TIdSync'

[bcc32 Warning] ftp_dm.h(103): W8111 Accessing deprecated
entity '_fastcall TIdSync::Synchronize()'

What can I change to avoid such warnings?

The deprecated warning messages should include the following text in
them:

'Use static TThread.Synchronize()'

TIdSync doesn't really offer any extra functionality over using
TThread::Synchronize() directly, especially when used with an anonymous
procedure (or a lambda in C++) to capture variables. That is why
TIdSync has been deprecated.

How to Handle Delphi Anonymous Methods in C++
http://docwiki.embarcadero.com/RADStudio/en/How_to_Handle_Delphi_Anonymous_Methods_in_C%2B%2B

If you want to keep using TIdSync and not change your code logic, you
will have to ignore the warnings, or disable them with #pragma
statements:

For the classic 32bit compilers:

#pragma warn -8111
#pragma option -w8111

http://docwiki.embarcadero.com/RADStudio/en/Pragma_warn

http://docwiki.embarcadero.com/RADStudio/en/W8111_Accessing_deprecated_entity_%25s_(C%2B%2B)

For the CLang compilers:

#pragma clang diagnostic ignored "-Wdeprecated-declarations"

http://clang.llvm.org/docs/UsersManual.html#controlling-diagnostics-via-pragmas

https://clang.llvm.org/docs/LanguageExtensions.html#messages-on-deprecated-and-unavailable-attributes

--
Remy Lebeau (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02