Tool News
 
 
 

Tool News

Products Info
Downloads
Tools FAQs
MAEC TOOL NEWS: MAECT-M3T-NC308WA-021201D

Notes on C compilers
M3T-NC308WA and M3T-NC30WA

Please take note of the following problems in using C compilers (with an assembler and integrated development environment) M3T-NC308WA and M3T-NC30WA:
  • On placing a #pragma ASM--ENDASM block immediately after the definition of an inline function
  • On defining inline functions


  1. Problem on Placing a #pragma ASM--ENDASM Block Immediately after the Definition of an Inline Function
    1.1 Products and Versions Concerned
    M3T-NC308WA V.5.00 Release 1
    for the M32C/80, M16C/80, and M16C/70 series MCUs
    M3T-NC30WA V.5.00 Release 1 and Release 2
    for the M16C/60, M16C/30, M16C/20, and M16C/10 series MCUs

    1.2 Description
    Placing a #pragma ASM--ENDASM block immediately after the definition of an inline function results in a parse error.

    1.3 Example
    ---------------------------------------------
       inline void func(void)
       {
                    /* Processing of an inline function */
       }
       #pragma ASM
                    ; Description in assembly language
       #pragma ENDASM
    ---------------------------------------------
    1.4 Workaround
    This problem can be circumvented in either of the following ways.
    (1) Place a #pragma ASM-ENDASM block before the definition of an inline function.
    [Example]
    ---------------------------------------------
       #pragma ASM
               ; Description in assembly language 
       #pragma ENDASM
       inline void func(void)
       {
               /* Processing of an inline function */
       }
    ---------------------------------------------
    (2) Define any function other than inline functions between an inline function and a #pragma ASM-ENDASM block.
    [Example]
    ---------------------------------------------------------------
       inline void func(void)
              { 
               /* Processing of an inline function */
       }
       static void dummy(void){}   /* Definition of a function other 
                                      than inline functions */
       #pragma ASM
               ; Description in assembly language 
       #pragma ENDASM
    ---------------------------------------------------------------
    1.5 Schedule of Fixing the Problem
    We plan to fix this problem in our next release of the products.


    Notes on C compilers M3T-NC308WA and M3T-NC30WA
    MAECT-M3T-NC308WA-021201D

  2. Problem on Defining Inline Functions
    2.1 Product and Versions Concerned
    M3T-NC30WA V.5.00 Release 1 and Release 2
    for the M16C/60, M16C/30, M16C/20, and M16C/10 series MCUs

    2.2 Description
    Defining any inline function may results in System Error being generated.

    2.3 Conditions
    This problem occurs if the following four conditions are satisfied:
    (1) Any one or more of the optimizing options -O, -O[3-5], -OR, and -OS are used.
    (2) No function except inline functions is defined between the definition of the last inline function and the end of the file.
    (3) A variable declared to be of type extern exists between the definition of the last inline function and the end of the file.
    (4) The variable in (3) is initialized between its declaration in (3) and the end of the file.

    [Notice] The definition of the last inline function stated in Conditions (2) and (3) is also applied to the one that is made in include files.

    2.4 Example
    ---------------------------------------------
       inline void func(void)
       {
                  /* Processing of an inline function */
       }
       extern int i;    /* Condition (3) */
       int i = 0;       /* Condition (4) */
    ---------------------------------------------
    2.5 Workaround
    Define a dummy function after the definition of the inline function.
    [Example]
    --------------------------------------------------------
       inline void func(void)
       {
               /* Processing of an inline function */
       }
       static void dummy(void){}    /* Definition of a dummy function */
       extern int i;
       int i = 0;
    --------------------------------------------------------
    2.6 Schedule of Fixing the Problem
    We plan to fix this problem in our next release of the product.




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