Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: Why does compiler warn about "mixing '||' and '&&'" for 64 bit compiles


This question is answered.


Permlink Replies: 3 - Last Post: Jul 15, 2017 6:02 AM Last Post By: Rudy Velthuis (... Threads: [ Previous | Next ]
Tom Roberts

Posts: 83
Registered: 6/21/05
Why does compiler warn about "mixing '||' and '&&'" for 64 bit compiles  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 15, 2017 1:41 AM
but not for 32 bit compiles?
Antonio Estevez

Posts: 613
Registered: 4/12/00
Re: Why does compiler warn about "mixing '||' and '&&'" for 64 bit compiles
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 15, 2017 2:37 AM   in response to: Tom Roberts in response to: Tom Roberts
El 15/07/2017 a las 10:41, Tom Roberts escribió:
but not for 32 bit compiles?

The 32-bit compiler is the classic Borland compiler but the 64-bit compiler is based on the clang compiler project.
That is, they are different compilers created by different development teams.

The clang compiler has a more sophisticated code analyzer (that's why it's slower) and warns you about potential problems.

Other case is a warn about add explicit braces to avoid dangling else:
    if (Contiditio1)
       if (Condition2)
          DoSomeThing();
       else
          DoOtherThing();
Tom Roberts

Posts: 83
Registered: 6/21/05
Re: Why does compiler warn about "mixing '||' and '&&'" for 64 bit compiles  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 15, 2017 5:34 AM   in response to: Antonio Estevez in response to: Antonio Estevez
Thanks Antonio.

Antonio Estevez wrote:
El 15/07/2017 a las 10:41, Tom Roberts escribió:
but not for 32 bit compiles?

The 32-bit compiler is the classic Borland compiler but the 64-bit compiler is based on the clang compiler project.
That is, they are different compilers created by different development teams.

The clang compiler has a more sophisticated code analyzer (that's why it's slower) and warns you about potential problems.

Other case is a warn about add explicit braces to avoid dangling else:
    if (Contiditio1)
       if (Condition2)
          DoSomeThing();
       else
          DoOtherThing();
Rudy Velthuis (...


Posts: 7,591
Registered: 9/22/99
Re: Why does compiler warn about "mixing '||' and '&&'" for 64 bit compiles  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 15, 2017 6:02 AM   in response to: Antonio Estevez in response to: Antonio Estevez
Antonio Estevez wrote:

El 15/07/2017 a las 10:41, Tom Roberts escribió:
but not for 32 bit compiles?

The 32-bit compiler is the classic Borland compiler but the 64-bit
compiler is based on the clang compiler project.

Actually, currently, there are two different 32-bit compilers. One of
them is clang-based too, the other is the classic Borland compiler.

--
Rudy Velthuis http://www.rvelthuis.de

"An intellectual is someone who has found something more
interesting than sex." -- Edgar Wallace.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02