Tool News
 
 
 

Tool News

Products Info
Downloads
Tools FAQs
RENESAS TOOL NEWS on July 1, 2008: 080701/tn1

A Note on Using the C/C++ Compiler Package for the M32R MCU Family M3T-CC32R V.5.01 Release 00
--With Making a Function-Like Macro Statement That Extends Over More Than One Line and Uses Comments Beginning with // or Enclosed with /* and */--


Please take note of the following problem in using the C/C++ compiler package for the M32R MCU family M3T-CC32R V.5.01 Release 00:
  • With making a function-like macro statement that extends over more than one line and uses comments beginning with // or enclosed with /* and */


1. Description
   If a function-like macro statement is made which extends over more than 
   one line and uses comment statements beginning with // or enclosed with 
   /* and */, the following error message may be dispatched during 
   compilation:
        error: unterminated comment

2. Conditions
   This problem may occur if the following conditions are all satisfied:
   (1) A function-like macro is stated extending over more than one line.
   (2) In the ending line of the macro in (1), a comment statement 
       beginning with // or enclosed with /* and */ is placed.
   (3) In the line immediately before the line in (2), another comment 
       statement beginning with // is placed.
   (4) The size of the C source file concerned is greater than 512 bytes. 
       Note that the size includes that of the include files if they are.

3. Example
   -------------------------------------------------------------------------
   #define SAMPLE_MACRO(a,b,c)  (a + b + c)
       /* This program part omitted */
   int func(void)
   {
       return SAMPLE_MACRO( 1,
                            2,   // No.2    <-- Conditions (1) and (3)
                            3);  // No.3    <-- Conditions (1) and (2)

   }
   -------------------------------------------------------------------------
   In the above example, the problem may not arise depending on the 
   descriptions of the omitted program part.

4. Workarounds
   Delete the comment statement in Condition (3), which begins with //, 
   or change it to the one enclosed with /* and */.

   Example:
       return SAMPLE_MACRO( 1,
                            2,   /* No.2 */  <-- Enclosed with /* and */
                            3);  // No.3



© 2008. Renesas Technology Corp., All rights reserved. Privacy | Legal