Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/23/01 10:39
Read: times


 
#16850 - RE: Keil, MSVC, BCB - consensus
OK, now I've tried it in C51 v6.20c and got exactly the same result as the other 3 compilers; viz,
* No warnings/error;
* lines spliced as before

However, I had found that Borland doesn't directly support Trigraphs, so I had to add a conditional-compile switch, and use real backslashes (visualise real backslashes where you see 'backslash'):
#if defined __BORLANDC__
#define MAX(A,B)                'backslash'
  if( A > B )                   'backslash'
      return A; // A is biggest 'backslash'
  else                          'backslash'
      return B; // B is biggest
#else
#define MAX(A,B)                ??/
  if( A > B )                   ??/
      return A; // A is biggest ??/
  else                          ??/
      return B; // B is biggest
#endif

int main( void )
{
	unsigned char a = 1;
	unsigned char b = 2;

	MAX( a, b )
}

Now, if I define __BORLANDC__ on my C51 command-line, I do get four C329 warnings, "single-line comment contains line-continuation" - and they refer to the wrong line numbers!

But it does still compile, and the generated code is still the same as in all the other cases!

So, in conclusion, there clearly is something funny about the C51 v6.20c preprocessor, but it seems to get the right answer in the end!

Maybe you should get your contact in Keil to review this thread?

(Thinks: maybe the preprocessor forgets that it's done the line splicing when it gives its line numbers?)

List of 18 messages in thread
TopicAuthorDate
Keil's 6.20c problem with comments            01/01/70 00:00      
RE: Keil\'s 6.20c problem with comments            01/01/70 00:00      
RE: Keil\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\            01/01/70 00:00      
RE: Keil\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\            01/01/70 00:00      
RE: Keil            01/01/70 00:00      
RE: Keil            01/01/70 00:00      
RE: Keil            01/01/70 00:00      
RE: Keil comments - correction            01/01/70 00:00      
RE: Keil, MSVC, BCB - consensus            01/01/70 00:00      
RE: Keil\'s 6.20c problem with comments            01/01/70 00:00      
RE: Keil\'s 6.20c comments - Craig            01/01/70 00:00      
RE: Keil, MSVC, BCB - consensus            01/01/70 00:00      
RE: Keil, MSVC, BCB - consensus            01/01/70 00:00      
RE: Keil\\\'s 6.20c problem with comments            01/01/70 00:00      
RE: Keil, MSVC, BCB - consensus            01/01/70 00:00      
RE: Keil, MSVC, BCB - consensus            01/01/70 00:00      
RE: Keil, MSVC, BCB - Peter            01/01/70 00:00      
First things first!            01/01/70 00:00      

Back to Subject List