Keil Logo

What's New in C251 Version 5.58

  • [C251 Compiler]
    • Corrected: the variable attribute __attribute__((aligned)) was overruled by the linker directive NOSORTSIZE. Example:
      unsigned char ucValg __attribute__((aligned(4)));   /* The variable ucValg must be aligned on 4-byte boundary */
      
      void main (void)
      {
      :::::::::::
      }
      
      The MAP file for the above definition shows that the variable 'ucValg' was located at address 00000009H which is not a 4-byte boundary.
      00000009H   EDATA    BYTE      ucValg
      
    • Corrected: under some circumstances wrong code will be generated in case of the following expression and high optimization levels:
      unsigned char GetByte(unsigned char i);
      unsigned short value;
      
      value = (GetByte(0) * 256) + GetByte(1);        /* Wrong result */
      
      Generated assembler code:
      ---- Assembler code for : (GetByte(0) * 256) -----
      000016 E4             CLR      A                ; Parameter passing via R11=A to the callee function GetByte.
      000017 9A000000    R  ECALL    GetByte?         ;
                                                      ; The GetByte return value (unsigned char) is passed to the caller function via R11.
      
      ---- Load word registers WR14 and WR12 for the upcoming multiplication ----
      00001B 0A7B           MOVZ     WR14,R11         ; WR14 = | 00  | R11 |
      00001D 7E640100       MOV      WR12,#0100H      ; WR12 = | 01  | 00  |
      000021 AD67           MUL      WR12,WR14        ; The result is stored in the double word register DR12 = | WR12 | WR14 |, DR12 = | 00  |  00  | R11 | 00  |
      
      ---- Assembler code for : GetByte(1) -----
      000023 7401           MOV      A,#01H           ;
      000025 9A000000    R  ECALL    GetByte?         ;
      
      000029 0A7B           MOVZ     WR14,R11         ; Overwrites previous result in word register WR14
      00002B 2D76           ADD      WR14,WR12        ;
      
    • Corrected: Unexpected warning C98 "'&': different levels of indirection. Example:
      typedef unsigned char   byte;
      typedef unsigned short  word;
      
      typedef struct {
        byte     data1;
        word     data2;
      } struct_type;
      
      byte processStruct(byte xdata*xdata* structPtr);
      
      void main(void) {
        struct_type xdata myStruct;
        struct_type xdata*xdata myStructPtr = &myStruct;  /* The compiler throws erroneously the warning C98 "'&': different levels of indirection */
      
        processStruct((byte xdata*xdata*)&myStructPtr);
      }
      
    • Corrected: reentrant function has wrong name when userclass Compiler directive is used. Example:
      #pragma USERCLASS(ecode=user)
      
      int foobar(int x) reentrant {   /* The name of the generated segment is "?PR?FOOBAR?TC_0" instead of "?PR?FOOBAR_?TC_0" */
        return x ? foobar(x) : x-1;
      }
      
  • [L251 Linker/Locater]
    • Corrected: under some circumstances the L251 ingnores the NOJMPTAB directive and and throws erroneously the following error:
      *** ERROR L210: I/O ERROR ON INPUT FILE:
          EXCEPTION 0021H: PATH OR FILE NOT FOUND
          FILE: C:\KEIL\C51\LIB\L51_BANK.OBJ
      
    • Corrected: Error L138 while optimizing a function at the end of a 2K or 64K segment.
  • [A251 Macro Assembler]
    • Corrected: under some circumstances the assembler shows wrong line numbers if an $include file cannot be found. The root cause for this behavior is the erroneous line number generation by the preprocessor. Example:
      NAME xxx
      S       SEGMENT  CODE
              RSEG  S
      #line                 ; The preprocessor generates wrong line numbers if an $include file cannot be found.
      PUT:    MOV   A,#x    ; The assembler shows these wrong line numbers inside the build output window as part of a warning or error message.
              RET
              END
      
      
  • [µVision4]
    • This C251 release comes with µVision4 V5.16.2.0.
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.