Tool News
 
 
 

Tool News

Products Info
Downloads
Tools FAQs
MESC TOOL NEWS: MESCT-NC308_1-000716D

NC308WA, NC30WA, NC79WA, NC77WA
Precautions

Please take note of the following problems in using C compilers (with assembler and integrated development environment) NC308WA for the M16C/80 series, NC30WA for the M16C/60 and M16C/20 series, NC79WA for the 7900 series, and NC77WA for the 77xx series of MCUs:
  • Assigning the address of a function to a variable of type pointer to another function results in a System Error being generated if the types of both functions are different from each other.
  • Folding floating-point constants may cause incorrect subtract operations to be performed.
  • Folding constants of type unsigned long may cause incorrect divide and modulus operations to be performed.


  1. Problem on Pointers Pointing to Functions
    Assigning the address of a function to a variable of type pointer to another function results in a System Error being generated if the types of both functions are different from each other.
    1.1 Versions Concerned
    NC308WA V.1.00 Release 1--V.3.00 Release 1
    NC30WA V.2.00 Release 1--V.4.00 Release 1
    NC79WA V.2.00 Release 1--V.4.00 Release 1
    NC77WA V.5.00 Release 1--V.5.20 Release 2

    1.2 Conditions
    This problem occurs if the following two conditions are satisfied:
    (1)A variable is declared to be of type pointer to a function.
    (2)The address of a function is assigned to the variable in (1) of type pointer to another function where the types of both functions are different from each other.

    1.3 Example

    
         --------------------------------------------------------------------
    
            extern int *func(int);
    
            void ff(void)
            {
                int  *(*fp1)(int);     /* Condition (1) */
                int  (*fp2)(int);      /* Condition (1) */
    
                fp1 = func;    /* No problem because the types are the same */
                fp2 = func;    /* Condition (2); System Error occurs because 
                               the types are different from each other */
            }
    
         --------------------------------------------------------------------
    
    
    1.4 Workaround
    Define the type of the function pointed to by a variable of type pointer as the same as that of the function whose address is assigned to the above variable.

    1.5 Schedule of Fixing Problem
    We plan to fix this problem in our next release.




    NC308WA, NC30WA, NC79WA, NC77WA Precautions
    MESCT-NC308_1-000716D

  2. Problem on Folding of Floating-Point Constants
    Folding of floating-point constants may cause incorrect subtract operations to be performed.
    2.1 Versions Concerned
    NC308WA V.1.00 Release 1--V.3.00 Release 1
    NC30WA V.2.00 Release 1--V.4.00 Release 1
    NC79WA V.2.00 Release 1--V.4.00 Release 1
    NC77WA V.4.00 Release 1--V.5.20 Release 2

    2.2 Conditions
    This problem occurs if the following two conditions are satisfied:
    (1)An operation is performed between a variable and a constant of type float or double, regardless of whether their types are the same or not.
    (2)The operation has any of the following four patterns:
    • A variable + constant 1 - constant 2
    • A variable - constant 1 - constant 2
    • Constant 1 + a variable - constant 2
    • Constant 1 - a variable - constant 2
    Note: This problem occurs when any of the above patterns comprises a part of a long expression, too.

    2.3 Example
        --------------------------------------------------------------------
            void func(void)
            {
                double  d1, d2;
    
                d1 = d2 + 1.0 - 1.0;          /* Interpreted as d1 = d2 + 2.0 */
                d1 = (d2 + 1.0 - 1.0) / d2;   /* Interpreted as d1 = (d2 + 2.0)/
                                                d2 */
            }
         --------------------------------------------------------------------
      
    2.4 Workaround
    Instead of describing operations between constants, use the result of them.

    2.5 Schedule of Fixing Problem
    We plan to fix this problem in our next release.



    NC308WA, NC30WA, NC79WA, NC77WA Precautions
    MESCT-NC308_1-000716D

  3. Problem on Folding Constant of Type Unsigned Long
    Folding constants of type unsigned long may cause incorrect divide and modulus operations to be performed.
    3.1 Versions Concerned
    NC308WA V.1.00 Release 1--V.2.00 Release 2
    NC30WA V.2.00 Release 1--V.3.20 Release 2
    NC79WA V.2.00 Release 1--V.3.20 Release 2
    NC77WA V.3.00 Release 1--V.5.20 Release 2

    3.2 Conditions
    This problem occurs if the following three conditions are satisfied:
    (1)A divide or modulus operation is performed between constants.
    (2)One or both of the constants are of type unsigned long(Casted or suffixed with UL).
    (3) One or both of the constants are within a range of 0x80000000L--0x0ffffffff

    3.3 Example
        --------------------------------------------------------------------
            void func(void)
            {
                /* The result is 0x00000000H though 0x5555555H expected. */
                unsigned long ul = (0x0ffffffffUL / 48UL);
                ...
            }
         --------------------------------------------------------------------
    
    


    3.4 Workaround
    Instead of describing operations between constants, use the result of them.

    3.5 Schedule of Fixing Problem
    We plan to fix this problem in our next release.






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