RELEASE NOTES COMPILER HC08

RELEASE NOTES CHC08 V5.0.25
Note: These Release Notes contain some information about the C++ Compiler. If your
license configuration does not include the C++ feature, just ignore all topics related to C++.
NOTE: Recompile all your sources

List of new Features
- An error message is issued when a function pointer has inconsistent qualifiers. A function pointer may have a qualifier that specifies
  the calling convention and one that specifies the pointer size. Example:
      int __far (* __far f)(void)
           ^          ^
      calling         pointer
      convention      size
  The declaration above describes a far function pointer (i.e. a far pointer to a far function). The HCS08 backend only accepts far pointers
  to far functions and near pointers to near functions. Any other combination (e.g. int __far (* __near f)(void)) will result in a compiler
  error. The compiler also checks the memory model (on banked memory model all functions are __far by default if not specified otherwise).
  Example: int __far (* f)(void) is legal if compiling for banked memory model but not for small or tiny.

List of fixed Bugs
- MTWX25846, no warning while referencing banked interrupt handler (3 byte large address) by 2 byte vector
- MTWX24638 , HC08 compiler generates internal compiler error instead issuing a compiler error message for not-supported pointer conversion,
  when converting linear pointers to function pointers when banked memory support is enabled.

  #pragma CONST_SEG __LINEAR_SEG LinearConstSegment
  const char first_function_in_linear_data[] = {0xae, 0x01, 0x8c, 0x96, 0x17, 0x00, 0x8d};
  const char second_function_in_linear_data[] = {0xae, 0x02, 0x8c, 0x96, 0x17, 0x00, 0x8d};
  const char third_function_in_linear_data[] = {0xae, 0x03, 0x8c, 0x96, 0x17, 0x00, 0x8d};
  #pragma CONST_SEG DEFAULT

  /* array with pointers to functions defined in linear data section */
  const char * __linear const functions_in_linear_data[] = {first_function_in_linear_data, second_function_in_linear_data, third_function_in_linear_data};

  void main(void)
  {
	  void (* __near near_ptr_func_call)(void);
    near_ptr_func_call = (void (*)()) functions_in_linear_data[0];
  }

- MTWX24367, HC08 compiler does not support implicit conversion for default function pointer to data pointer when banked memory support is enabled.
  Example:
  void * __linear fifi;

  void pointed(void);

  void caller(void) {
    fifi = pointed;
  }
- Not logged: wrong type definitions in hiware.h.

  typedef sWord uint16;
  typedef Word int16;

  The code above was changed to:
  
  typedef Word uint16;
  typedef sWord int16;

Limitations
- Help System
- Some topics are not available yet in the compiler help file. Requesting Help about
  such a topic opens an error window. The help topics will be extended in the next
  release.

List of known Bugs
- #MTWX26459, the conversion from a member of an array of linear pointers to a near function pointer is not supported by the compiler.
  Consider the following snippet:

  #pragma CONST_SEG __LINEAR_SEG LinearConstSegment
  const char first_function_in_linear_data[] = {0xae, 0x01, 0x8c, 0x96, 0x17, 0x00, 0x8d};
  const char second_function_in_linear_data[] = {0xae, 0x02, 0x8c, 0x96, 0x17, 0x00, 0x8d};
  const char third_function_in_linear_data[] = {0xae, 0x03, 0x8c, 0x96, 0x17, 0x00, 0x8d};
  #pragma CONST_SEG DEFAULT

  /* array with pointers to functions defined in linear data section */
  const char * __linear const functions_in_linear_data[] = {first_function_in_linear_data, second_function_in_linear_data, third_function_in_linear_data};

  void __near (* __near near_ptr_func_call)(void);
  void main(void)
  {
 	  near_ptr_func_call = (void (*)()) functions_in_linear_data[0];
  }

  Error C18002 is issued:

   near_ptr_func_call = (void (*)()) functions_in_linear_data[0];
   ^
  ERROR C18002: Pointer conversion not supported

- #MTWX23456, compiler generates Error : C5701: Internal Error #1044 for the following

const char keyDownMessages[ NUMBER_OF_SWITCH_BITS ] =
{
    "unused",
    "Piston1 Down",
    "Piston2 Down",
    "Piston3 Down",
    "VolumeUp Down",
    "VolumeDown Down",
    "ScrollUp Down",
    "ScrollDown Down",
};

  Workaround is to declare it correctly, as an array of pointers and not an array of char:  const char* keyDownMessages[ NUMBER_OF_SWITCH_BITS ]

Demo Version Limitations
If you do have a demo version of the compiler, there are following limitations:
- Total code size for a source file (compilation unit) is limited to 1024 bytes



RELEASE NOTES CHC08 V5.0.24
Note: These Release Notes contain some information about the C++ Compiler. If your
license configuration does not include the C++ feature, just ignore all topics related to C++.
NOTE: Recompile all your sources

List of new Features
- Local linear pointer initialization. Example:
  #pragma CONST_SEG __LINEAR_SEG MyLinearData
  int myLinearAddress[] = {1, 2, 3};
  void f() {
    char * __linear p = myLinearAddress;
  }
  
List of fixed Bugs
- The compiler issues errors when an illegal linear pointer operation is performed. Example:
  char * __linear p, c;
  /* ... */
  c = *p; /* Error: explicitly use the LAP registers instead ! */
  /* ... */
  c = p[2];/* Error: explicitly use the LAP registers instead ! */
- Linear pointer conversions to and from far function pointers did not work.

Limitations
- Help System
- Some topics are not available yet in the compiler help file. Requesting Help about
  such a topic opens an error window. The help topics will be extended in the next
  release.
- Linear pointer conversions to 16-bit data and function pointers are not supported (due
  to the fact that it is error prone). An error is issued for these situations.
  
List of known Bugs
- MTWX24638 , HC08 compiler generates internal compiler error instead issuing a compiler error message for not-supported pointer conversion,
when converting linear pointers to function pointers when banked memory support is enabled.

#pragma CONST_SEG __LINEAR_SEG LinearConstSegment
const char first_function_in_linear_data[] = {0xae, 0x01, 0x8c, 0x96, 0x17, 0x00, 0x8d};
const char second_function_in_linear_data[] = {0xae, 0x02, 0x8c, 0x96, 0x17, 0x00, 0x8d};
const char third_function_in_linear_data[] = {0xae, 0x03, 0x8c, 0x96, 0x17, 0x00, 0x8d};
#pragma CONST_SEG DEFAULT

/* array with pointers to functions defined in linear data section */
const char * __linear const functions_in_linear_data[] = {first_function_in_linear_data, second_function_in_linear_data, third_function_in_linear_data};

void main(void)
{
	void (* __near near_ptr_func_call)(void);
	near_ptr_func_call = (void (*)()) functions_in_linear_data[0];
}


- MTWX24367, HC08 compiler does not support implicit conversion for default function pointer to data pointer when banked memory support is enabled.
  Example:
  void * __linear fifi;
 
  void pointed(void);
 
  void caller(void) {
    fifi = pointed;
  }

  Compiler issues an error:

  >> in "D:\junk\conv_test\test.c", line 14, col 3, pos 146
     fifi = pointed;
  ^
  ERROR C18002: PTR_TO_LINEAR pointer conversion not supported

  Workaround is to explicitly declare pointed function as __far.
- #MTWX20194, C++, nested template classes not compilable.
  Example:
  class A {
    ...
    template <int i> class B {
    ...
    };
  };
- #MTWX23456, compiler generates Error : C5701: Internal Error #1044 for the following

const char keyDownMessages[ NUMBER_OF_SWITCH_BITS ] =
{
    "unused",
    "Piston1 Down",
    "Piston2 Down",
    "Piston3 Down",
    "VolumeUp Down",
    "VolumeDown Down",
    "ScrollUp Down",
    "ScrollDown Down",
};

  Workaround is to declare it correctly, as an array of pointers and not an array of char:  const char* keyDownMessages[ NUMBER_OF_SWITCH_BITS ]

Demo Version Limitations
If you do have a demo version of the compiler, there are following limitations:
- Total code size for a source file (compilation unit) is limited to 1024 bytes


RELEASE NOTES CHC08 V5.0.23
Note: These Release Notes contain some information about the C++ Compiler. If your
license configuration does not include the C++ feature, just ignore all topics related to C++.
NOTE: Recompile all your sources

List of new Features
- Floating license lingering time has been reduced from 10 minutes to 5 minutes to make floating licenses faster available for another user.
  Note that the floating license server administrator can extend the lingering time using a configuration file (see Macrovision FLEXlm documentation for details).
- MMU (Memory Management Unit) support for HCS08. Use -MMU to enable this feature.
- Banked Memory Model for derivatives with MMU. Use -Mb to set the memory model to banked.
  When using this memory model the compiler will consider that all the functions (except the
  ones defined with the "__near" qualifier) are reachable using a CALL instruction only. This
  is also the case when using the small memory model for functions marked with the "__far" qualifier.
- Partial support for the extended data access available to HCS08 chips with MMU. The compiler supports
  24-bit pointers. This pointers are marked with the "__linear" qualifier and can only be used for data
  storage. Library functions and macros are supplied for reading data using the MMU.
- The inline assembler supports CALL and RTC instructions.

List of fixed Bugs
- MTWX23611: compiler hangs on for(;;) loop containing some inline assembler. very singular case.
- MTWX23369: IDE crash when compiling a program containing a programing error. 
             The reason for the IDE crash was a stack overflow on the host (x86) because of endless recursion.
- MTWX22355: HC08 intrinsics not working with the -Ont switch.
- MTWX23147: The peephole that removes unnecessary tests did not take into account the situation where the 
             instruction before the test writes the index register while the test itself reads the value 
             pointed by the index register.

Limitations
- Help System
- Some topics are not available yet in the compiler help file. Requesting Help about
  such a topic opens an error window. The help topics will be extended in the next
  release.
- Code banking and 24 function pointers are NOT supported yet.

List of known Bugs
- #MTWX20194, C++, nested template classes not compilable.
  Example:
  class A {
    ...
    template <int i> class B {
    ...
    };
  };

Demo Version Limitations
If you do have a demo version of the compiler, there are following limitations:
- Total code size for a source file (compilation unit) is limited to 1024 bytes

RELEASE NOTES CHC08 V5.0.22
Note: These Release Notes contain some information about the C++ Compiler. If your
license configuration does not include the C++ feature, just ignore all topics related to C++.
NOTE: Recompile all your sources

List of new Features

List of fixed Bugs
- no bug number: The runtime support rtshc08.c did contain a bug for floating point calculation when it was compiled with -Ot (optimized for time).
             This setup did not happen often as usually the runtime support is 
             taken out of the pre-built library, and -ot is also not the default, and many are not using floating point.
- MTWX21952: wrong optimization of switch selector to signed char (should be unsigned char)
             Example: unsigned char a; switch(a & 0xF0) ...
- MTWX21765: internal error when trying to spill an operand that has been defined as a return value of runtime call.
             general workaround: use option -one
- MTWX21593: Unnecessary saving/restoring of index register to stack
- MTWX21508: Contain of the H:X register is trashed when dereferencing pointers
- MTWX21020: wrong SP offset for access to local variable before function call. HCS08 only. Only in singular cases with specific context.
- MTWX21429: wrong code generated for volatile variable access in certain situations. 

Limitations
- Help System
- Some topics are not available yet in the compiler help file. Requesting Help about
  such a topic opens an error window. The help topics will be extended in the next
  release.
- Code banking and 24 function pointers are NOT supported yet.

List of known Bugs
- #MTWX20194, C++, nested template classes not compilable.
  Example:
  class A {
    ...
    template <int i> class B {
    ...
    };
  };

Demo Version Limitations
If you do have a demo version of the compiler, there are following limitations:
- Total code size for a source file (compilation unit) is limited to 1024 bytes


RELEASE NOTES CHC08 V5.0.21
Note: These Release Notes contain some information about the C++ Compiler. If your
license configuration does not include the C++ feature, just ignore all topics related to C++.
NOTE: Recompile all your sources

List of new Features
- New compiler option: -O0, equivalent to -OiLib= -OnX -OnB -OnP -Onf -Onu -Onbf -Onca 
  -Oncn -One -Onbt -OnCstVar -Ont.

List of fixed Bugs
- MTWX20817: spill conflict after trying to reload the X register. A conflicting TAX destroyed the spill.
- MTWX20634: when the license file is accessed using the path from the LM_LICENSE_FILE environment variable (i.e. there is no license.dat in the
  tool's directory or its parent, nor is there a hiware.dat license file), and a required feature expires in less than 10 days, a crash occurs.
  This bug is fixed for build numbers greater than 6088.
- MTWX20608: Incorrect code generated when some similar - but not identical - statements appear under different "case" labels of a "switch" statement.
- MTWX20563: internal error after referring to memory that has been freed before. fixed by removing the wrong reference. bug happened together with inline assembler.
- MTWX20033: internal error after illegal initialization of a string.
             Example: const unsigned char MAJ_ETHERNET[]={"A",0};
- in checksum.h, all available checks were enabled by default. 
  This resulted in a slow and non configurable setup. Now only a single checksum is computed by default, 
  and this setting can be overruled with defines without modifying checksum.h.
  To restore the previous behavior, define _CHECKSUM_CHECKSUMS_ when compiling checksum.c and start12.c, 
  for example by adding -D_CHECKSUM_CHECKSUMS_ to the compiler command line.

Limitations
- Help System
- Some topics are not available yet in the compiler help file. Requesting Help about
  such a topic opens an error window. The help topics will be extended in the next
  release.
- Code banking and 24 function pointers are NOT supported yet.

List of known Bugs
- #MTWX20194, C++, nested template classes not compilable.
  Example:
  class A {
    ...
    template <int i> class B {
    ...
    };
  };

Demo Version Limitations
If you do have a demo version of the compiler, there are following limitations:
- Total code size for a source file (compilation unit) is limited to 1024 bytes


RELEASE NOTES CHC08 V5.0.20
Note: These Release Notes contain some information about the C++ Compiler. If your
license configuration does not include the C++ feature, just ignore all topics related to C++.
NOTE: Recompile all your sources

List of new Features
- Licensing version number for FLExlm has been updated to 5.000.
- global initializations with constant address differences between the same object are now possible.
  Example:  
  struct {
    int a,b,c;
  } s;
  int diff = (char *)&s.c - (char *)&s.a;
- using the option -Oc does now cause the message "C54: Option -Oc: depreciated". This option is also no longer displayed in the 
  graphical user interface.
  With previous compilers, using -oc was silently ignored. 
  Note: There are other option to control the actually done common subexpression elimination.
- MTWX14650: cycle counts are now reported in the listing file (option -Lasm) as well. You can switch this off using -Lasmc=y.
- Moved the macro CLOCKS_PER_SEC from hidef.h into time.h
- Lingering time for floating licenses has been extended to 10 minutes, to allow caching of licenses (to reduce compilation time)

List of fixed Bugs
- MTWX19701 wrong spill after loading the byte count for _COPY into A register. The byte count in A was overwritten, 
  hence a wrong byte count was passed to the _COPY runtime routine. happens with option -or only.
- MTWX19432: internal error while compiling a ? operation with unary + operator on indirect memory.
             Example: * ptr < 0 ? - * ptr: + * ptr.
             the internal error happens only with option -cni
- MTWX19303, internal error when trying to access a spill on stack that has not yet been generated. happens only with option -or.
- MTWX18918, internal error while accessing a 16 bit large struct field with struct offset 255 bytes. 
  The second byte which has 256 bytes offset could not be reached with the 8 bit displacement.
- MTWX18918: unary operations (increment, decrement and negation) of a 16 bit structure field with exact offset of 0xFF did cause an internal compiler error.
  The compiler did not handle the low byte access to offset 0x100 correctly.
- MTWX18804, in tiny memory model the pointer arithmetic size was too small if the address of a 2 dimensional array
  was passed as parameter with far pointer type.
  
  Example:
  #pragma DATA_SEG __FAR_SEG FarData
  char arr[2][3];
  #pragma DATA_SEG DEFAULT
  void foo(char *__far p);
  void bar(char i) {
    foo(&arr[i][0]);
  }

- Opening files from the builtin Windows GUI with double clicking did cause a crash 
  if the File->Configuration->Editor Settings dialog was configured as "CodeWarrior (with COM)" and if an old IDE 4.1 was 
  configured as current CodeWarrior IDE to be used. It did work as expected with if any
  more recent CodeWarrior IDE was registered.
- MTWX17549, MTWX19584: CHC08 peephole optimizer used flags set by a 16 bit store (workaround -ont=c) 
  instead of testing the flags of the high byte
- MTWX16943, MTWX17326: fixed flash boot protect is at 0xFF7E (gp32_registers.inc)
- MTWX17364/MTWX9477 (fix already contained HC08 V3.1 build): icg cse did incorrectly reuse Array[var+const] or Array[const+var] to implement another access of the form Array[const-var]. 
  The negative sign of the var variable was not taken into account.
- MTWX17218: fixes/corrections in project readme file ((CodeWarrior_Examples)\HC08\HC08 SIMULATOR\HC08 PeripheralsDemo).
- MTWX17212: IEEE32 runtime routines did not correctly detect NAN/infinity cases. The code was present in rtshc08.c but it did not work. 
  Only computations with infinity/NAN values are affected.
- MTWX17160: improved wording in derivative header files (comment).
- MTWX17087: fixed typos in start08.c.
- Preprocessor conditions are now evaluated with long arithmetic.
  The previous compiler did use the same arithmetic when evaluating preprocessor conditions
  as when evaluating constant conditions in C code.
  However ANSI C 89 mandates that for preprocessor conditions (#if's)
  the int representation should be enhanced to the representation one of long.
  Example (assuming int is 16 bit):
  
  #if 30000 + 30000 + 30000 == 90000 // TRUE
  #endif
  void test(void) {
    if (30000 + 30000 + 30000 == 90000) { // FALSE
    }
  }
  Explanation:
  For ANSI C, the result of a int + int operation has the type int.
  Therefore the type of "30000 + 30000 + 30000" is int. 
  If int is 16 bits the additions do overflow and the condition evaluates to FALSE.
  However while evaluating the expression for the preprocessor, int is extended to 32 bits.
  Therefore the additions do no longer overflow and the expression in the #if evaluates to TRUE.
- switch search table runtime routines _Search_Table_8_Addr and _Search_Table_8_Offset did contain a bug which could
  cause wrong code to be executed for switch values larger then the largest case entry but smaller than 256.
- MTWX16009 reduce complexity from exponential to linear time. It only happened for empty switch statements with a certain number of case labels.
  The compilation time was O(2 ^ nof_labels). Now it is O(nof_labels).
- MTWX15815: TBCR register address was wrongly put as 0x46 but should be 0x51 per data sheets (lib\hc08c\include\ap32_registers.inc,
  ap16_registers.inc and ap64_registers.inc. 
- MTWX15771: avoid wrong floating point conversion optimization: -(double)(int) ->(double)-(int) opti
- MTWX15441: Internal overflow with many include files fixed. 
  This overflow did cause wrong debug (line) information or could also cause crashes.
  In addition increased the limitation to 512 concurrent include files.

Limitations
- Help System
- Some topics are not available yet in the compiler help file. Requesting Help about
  such a topic opens an error window. The help topics will be extended in the next
  release.
- Code banking and 24 function pointers are NOT supported yet.

Demo Version Limitations
If you do have a demo version of the compiler, there are following limitations:
- Total code size for a source file (compilation unit) is limited to 1024 bytes


RELEASE NOTES CHC08 V5.0.19
Note: These Release Notes contain some information about the C++ Compiler. If your
license configuration does not include the C++ feature, just ignore all topics related to
C++.
NOTE: Recompile all your sources

List of new Features
- 1-51516766, MTWX10212: the compiler warns if the data types passed to function exceeds the prototype given:
  void function(unsigned char l,unsigned int h);
  volatile unsigned long j,i;
  void main(void) {
    function(j,i);  
  }
- There is a new macro _FEED_COP supported in the startup code. When this macro is set, the COP (Computer Operates Properly) timer is reset during the global initialization phase.
- There are also new macros to explicitly enable/disable the COP in start08.c. Note however that there are side effects because of write once registers. Therefore only use these COP enable/disable macros with care.
- Mapping unknown messages is now treated as warning and no longer as error. This change allows to maintain compatibility with old build tools when removing no longer used messages.
- Message C2402, "Variable <varname> allocated in ROM" or "Variable <varname> allocated 'far'" is now disabled by default.
  The message can still be explicitly enabled.
- new option -LpCfg=m to suppress information about file names in preprocessing output file (option -Lp)
- new option -LpCfg=e to allow empty lines in preprocessing output file (option -Lp)
- 1-54681434: New option -LicWait. If set and used with floating license configuration, if no license is available from the license server,
  it will wait until a license is available. This is useful if you want to wait until a license is free, e.g. with batch jobs.
- Support for binary numbers (e.g. 0b100101). See compiler manual for details.
- the startup code start08 does now support the define __ONLY_INIT_SP which generates just the minimal code to call main.
  Global variables are not initialized when this define is specified in the command line (-D__ONLY_INIT_SP).
- The messages C1800 and C1801 (missing prototype) show now the function name causing the message too
- The about box (and option -Lic) shows now as well borrowing status (same as lmborrow.exe -status)
- New option -LicBorrow:
  -LicBorrow    Borrow license feature (-LicBorrow<feature>:<Date>, <Date> in dd-mmm-yyyy[:hh:mm] format and 
  time in 24-hour hh:mm format)
  It enables selective borrowing of features (supported by the application). Note that borrowing is only supported
  if enabled in the license file by the BORROW keyword.
- In case of an expire/evaluation license, you are now warned 10 days before the license expires.
  The warning dialog box pops up once every day.
- The check for demo or license limitation on code size happens now at the end of the compilation unit.
  In case you are running into such a limitation, this provides better feedback and an indication
  what kind of upgrade license would be required.
- FLEXlm support for BORROWING. Note that BORROWING is only available for floating licenses, and may be sold
  as a separate product or for an additional fee. BORROWING is used so you can work with a floating license
  even if you are disconnected from the licensing server. See FLEXlm user manuals for details on BORROWING.
  Note that this product needs a FLEXlm daemon (metrowks.exe on the licensing server) with following
  version information:
  FLEXlm v8.4a (lmgr.lib), Copyright (c) 1988-2003 by Macrovision Corporation. All rights reserved.
  The latest FLEXlm floating server software can as well be downloaded from the www.metrowerks.com
  web page, or get in touch with support to get the latest version.
- Extended CodeWarrior IDE coloring files (located in bin\editor). The coloring supports now additional
  predefined macros defined by the compiler. You can get such a list of predefined defines using the compiler
  option -Ldf.

List of fixed Bugs
- MTWX12534: HC08 compiler generated wrong SP offsets for function pointer calls, if register parameters are used.
- MTWX13951: fixed wrong addressing mode changes in frame pointer optimization (L1907 error occurred in bug case).
- Fixed: preprocessor bug. macros which do expand to a function style macro with the braces not being part of expanded part of the initial macro are now correctly handled.
- Fixed: only numbers starting with a digit were accepted for hex notation (e.g. $1234) in
  inline assembly. Now the full range of hexadecimal numbers are accepted. See compiler manual for details.
- MTWX9027: Constant replacement although option -OnCstVar was given.
- MTWX9634: The default value for -BfaGapLimitBitsBit was changed from 3 to 0.
  Unfortunately this change did also cause that 16 single bit bitfields were now allocated as one single 16 bit field while
  while previous compiler versions did allocate them as two times a 8 bit bitfield.
  E.g.
  struct A {
   int i0:1;
   int i1:1;
   int i2:1;
   int i3:1;
   int i4:1;
   int i5:1;
   int i6:1;
   int i7:1;
   int i8:1;
   int i9:1;
   int i10:1;
   int i11:1;
   int i12:1;
   int i13:1;
   int i14:1;
   int i15:1;
  } a;
  For HC08 V3.0, the bitfield i0 is the lowest bit of a 16 bit a value. As the HC08 is bigendian,
  this turns out to be at the byte-offset 1 of a. i15 on the other hand is allocated by HC08 V3.0 at byte-offset 0
  with mask 0x80.
  For HC08 V2.x, the bitfield i0 is the lowest bit of the first byte of the a value. Therefore it has mask 1 and byte-offset 0.
  i15 on the other hand is allocated by HC08 V2.x with mask 0x80 at byte-offset 1.
- 1-53814465: in case of ClearCase version control plugin, and if the local settings for decimal point were not '.', license checkout
  was not working in all cases.
- for -LpCfg=s: preprocessor output, reconstruct spaces. User code using interrupt is emitted with the equivalent but longer __interrupt.
  However this length difference was not taken into account causing non compilable code.
- updated help file (chc08.hlp). Previous help file did not work for context sensitive F1 help in all cases.
- MTWX11843: treeopt bug for patterns "a -= b; a++;" and "a++; a-= b;". Treeopt generated "a -= b + 1;" instead of "a -= b - 1;"
- MTWX10491, wrong address calculation for pattern
  char array[100];
  ...
  (int) (*(int *)((&array[idx] ) + 2))
  The cast to int*, the index 'idx' and the offset '2' are necessary to get this bug
List of known Bugs
- none.


RELEASE NOTES CHC08 V5.0.18
Note: These Release Notes contain some information about the C++ Compiler. If your
license configuration does not include the C++ feature, just ignore all topics related to C++.
NOTE: Recompile all your sources

List of new Features
- Changed access order to objects declared with 'volatile', typically IO registers:

  volatile unsigned int TCNT;
  TCNT = 0x1234;

  gives now code that accesses the low address byte first:

  LDA   #52
  LDX   #18
  STX   TCNT
  STA   TCNT:1

  previous compiler versions accessed all objects high address byte first.

- Change default value for option -BfaGapLimitBits to 0 (was 3 bits).
  To prevent wrong I/O register accesses, the compiler will no longer insert extra gaps into bit field structure (he did it for optimization)
  by default. This change is related to WB1-49951.
- Cosmic compatibility mode (option -ccx):
  The compiler now accepts the Cosmic style space modifiers @near, @far and @tiny and emulates the same
  semantics as the Cosmic compiler, i.e. objects are allocated into special _CX_xxxxx sections that can
  be mapped to appropriately into zeropage RAM, near or banked ROM or RAM. See the compiler manual for
  more details. See also TN 234 for other important aspects of porting applications from Cosmic to
  CodeWarrior (calling convention, Assembler, etc)
- WB1-45472: issue a message 'lost of data' as well for unsigned char like 'uc = 0x1234;'.
- New option -lpcfg for preprocessor output in #line format. This is useful e.g for instrumenters to get
  the source file and -line easily.

List of fixed Bugs
- sscanf did not exactly follow the ANSI standard about returning EOF for input failures if no conversions where done.
  It did return EOF also for some conversion failures if no conversions where done.
  %n was also not considered as conversion in this respect.
- MTWX9552: The -Onx frame optimization did cause an endless loop or out of memory error for CBEQ off,SP,dest for some constellations.
- No bugnr yet: the -one CSE optimization did not correctly handle the following case:
   const unsigned char arr[192]; unsigned char uc,uc1,uc2; char test(void) { uc2 = arr[0x40 + uc];  uc1 = arr[0xc0 - uc]; }
   Note: this only happened for array index calculation with the constant on the left side.

- renamed derivative source and header files MC68HC908AB16A.c/h to correct name MC68HC08AB16A.c/h
- WB1-51395: constants were replaces although option -OnCstVar was specified
- avoid crash for (more than) 4092 open #if without any #endif. New behavior is to issue
    C4449: Exceeded preprocessor #if level of 4092
- 1-49728412/1-49949006: Inlining bug:
  with inlining enabled (-oi=c10) code like
  if (x && fun()) { X; } else { Y; }
  did not execute Y in some cases (even if fun was not inlined)
- The #asm directive did have to be consistently balanced with #endasm with respect to #if 0/#endif's.
    #asm's in "#if 0" areas did have to balance as well.
    For example, the following code did not compile with an missing #endif error message
    #if 0
      #asm
    #endif
    The new behavior does no longer require that #asm's in not processed areas are terminated with a #endasm.
    However, processed #asm's do still need an #endasm on the same level.
    The previous code does now compile while the following code will still issue an error.

    #if 1
      #asm // error, no #endasm before the endif. #endasm's outside the surrounding or inside of another
           // #if #endif pair are not supported.
    #endif

    #endasm

List of known Bugs
- none.


RELEASE NOTES CHC08 V5.0.17

List of new Features
- new pragma LINK_INFO to pass information into the ELF file to the linker.
- IMPORTANT: The SCI module termio.c has been removed from the ANSI-C
  library because it is hardware dependent. If you use functions from termio you have
  to link termio.o explicitly from now on.
- The macro '__MWERKS__' is now defined with the value 1 by default in the
  compiler: #define __MWERKS__ 1
- Defining string constants in inline assembly is now supported.
  Example: asm DCB "hello", "world";
- IMPORTANT: New code generation option cs08 allows generation of HCS08 code.
  HCS08 code does not run on native HC08 devices, but native HC08 code still runs on
  HCS08 devices. For most applications, HCS08 code is about 20% more compact than
  native HC08 code.

List of fixed Bugs
- sscanf did not exactly follow the ANSI standard about returning EOF for input failures if no conversions where done.
  It did return EOF also for some conversion failures if no conversions where done.
  %n was also not considered as conversion in this respect.
- WB1-45225, wrong compination of bit set and bit clear operations in a singular case.
- The HLI did not support struct field accesses in the MOV instruction.
- The ANSI library function strtoul did incorrectly handle the "0" string for the automatic base detection case.
  As this function is used by sscanf and strtol these function did behave incorrectly as well.
  E.g.
  >char *endptr;
  >unsigned long res= strtoul("0", &endptr, 0);
  Did result in  endptr pointing to "0" instead of the 0 byte afterwards.
- WB1-43181  missing error message on attempt to init a static member in constructor
- WB1-43148, missing error message on pointer assignment with same struct name as
  base type, but different owner classes:
  class XXX {
     public:
       struct S {
         int a;
         float b;
       };
    };
    class YYY {
     public:
       struct S {
         float c;
       };
    };
    void main() {
      const XXX::S xs = {1, 2.0 };
      const YYY::S ys = { 3.0 };
      const XXX::S *p_xs = &ys;   // missing error message here
    }
  - WB1-43151,  overloading rules were not considered before checking access to
    protected member:

  class X {
      public:
         static void f(int b, int c) {}
      protected:
        static void f(int a, int b, int c) {}
    };
    void main() {
      X x;

      x.f(1, 2);   // worked
      X::f(1, 2);  // did not work, because the compiler tried to call the 2nd member
    }

List of known Bugs
- none

Limitations
- Help System
- Some topics are not available yet in the compiler help file. Requesting Help about
  such a topic opens an error window. The help topics will be extended in the next
  release.
- Code banking and 24 function pointers are NOT supported yet.

Demo Version Limitations
If you do have a demo version of the compiler, there are following limitations:
- Total code size for a source file (compilation unit) is limited to 1024 bytes


RELEASE NOTES CHC08 V5.0.16
Note: These Release Notes contain some information about the C++ Compiler. If your
license configuration does not include the C++ feature, just ignore all topics related to C++.
NOTE: Recompile all your sources

List of new Features
- This version uses a new FLEXlm daemon (the Metrowerks one). If you already
  have a license for the former version, you need to upgrade your license.
  Additionally be aware that in compliance with other Metrowerks tools the license
  (license.dat) file in the installation root (e.g. c:\metrowerks\license.dat, the
  installation script has created a shortcut to this file) is used. If such a license.dat
  exists, this file is used to check out the license. Only if this file does not exist, the
  one in C:\FLEXlm is used.
- The option LL does now include the stack size used by every function.

List of fixed Bugs
- When running as plug-in CodeWarrior, the generation of browse information did
  slow down the compilation considerably for large files containing many defines.
- At the line end, when a backslash was followed by a space before the line end, the
  compiler did still treat it as line continuation in some cases. The new compiler
  will no longer join the two lines. Note: According to ANSI C, escaping a space is
  not allowed.

List of known Bugs
- none


RELEASE NOTES CHC08 V5.0.15
Note: These Release Notes contain some information about the C++ Compiler. If your
license configuration does not include the C++ feature, just ignore all topics related to C++.
NOTE: Recompile all your sources

List of new Features
- Several improvements on code quality according:
- parameter passing
- integer compares with indexed arrays, e.g. if(arr[i] == arr2[j+1]) {
- BRA to RTS is optimized even if there is exit code in between. The exit code is
  copied and the branch replaced by a RTS. This is only optimized if ot is active
- New option Asr: It's assumed that HLI code saves written registers. When this option
  is set, the compiler is allowed to keep values in a register over HLI code. Misuse of
  this option leads to incorrect code.
- R2852, generation of PSHH and PULH in interrupt function entry/exit can now be
  disabled using the pragma TRAP_PROC SAVE_NO_REGS.
- R2887: Inlining can now be disabled for a single function with the new #pragma
    NO_INLINE.
  E.g.:
  #pragma NO_INLINE
  void f(void) { /* don't inline this function even with oi */
  }

List of fixed Bugs
- R2904, wrong  address  calculation, if address is used more than once and the
  additional offset is >= 256 bytes.
- R2911, wrong error message for ( ( struct my_struct * ) 0 ) -> ram [ 1 ] = 0x34 ; error
  appears only if pointer is 0.
- R2902, wrong parameter passing from zero page to a function with float parameters
  (only 1 byte of the address was pushed although the function expects the whole
  address pushed)
- R2882, internal error while optimizing a character sized expressions like
  (a & b) | (c & b) into (a | c) & b.
- R2859, wrong translation of a 2 byte assignment with destination in zeropage, if the
  address of the source operand is reused later.
  Example: (PVAL1 and PVAL4 are 2 shorts in zeropage, m_active_pwm is a short
  outsize zeropage)
    PVAL1 = m_active_pwm;
    PVAL4 = m_active_pwm;
- R2832, generation of warning for implicit conversion from const X * to X *  in C

List of known Bugs
- none

RELEASE NOTES CHC08 V5.0.14
Note: These Release Notes contain some information about the C++ Compiler. If your
license configuration does not include the C++ feature, just ignore all topics related to C++.
NOTE: Recompile all your sources

List of new Features
- New preprocessor directive #warning. Same as #error, but instead resulting in an
  error message, this directive produces a warning message only. Additionally, the
  message generated by #error can now be moved to another message kind.
- Binary constants are now supported when the option -Ansi is not set Example:
  var = 0b0101011

List of fixed Bugs
- R2787, a crash occurs in initialization member (see below)
  Example
  Class A {
    Public:
    int i;
   A():i(){}
  }
- R2782 crash for multiple bitfield assignments in singular cases (use onbf to avoid).
- R2780 wrong IEEE32 result for 2.0178E-43 - 1.0E-37. Result was not negative.
- Rxxxx, missing kill after a function call of local variable from whom the address was
  passed to the same function. This resulted into wrong CSE for this local variable. The
  bug only occurs in complex control flow.

List of known Bugs
- None.


RELEASE NOTES CHC08 V5.0.13
Note: These Release Notes contain some information about the C++ Compiler. If your
license configuration does not include the C++ feature, just ignore all topics related to C++.
NOTE: Recompile all your sources

List of new Features
- The default object file format has been changed to ELF DWARF 2.0. To get the
  HIWARE format, the option fh has to be set.
- Direct access to following processor flags: C, H, V, I, M.
  Example: if(__isflag_carry()) goto label    translates to BCS label.
- Inline assembler supports now the following syntax: #asm .. #endasm in
  function body - See manual for details.
  Example :
  #asm
    nop
    nop
  #endasm
- R2728: Now possible to initialize a byte constant with the LSbyte of the address of an
  absolute variable.
  Example: int absVar@0x1234; const char lowAddr=(char)&absVar+5;
- Inline assembler supports now the following syntax: asm ( One_instruction )
  Example : asm(nop) - See manual for details.
- Inline assembler supports strings - See manual for details
  Example: _asm("nop") or _asm(" nop; nop ; nop") or _asm "nop; nop"
- New option cs08 to generate HCS08 code. The macro __HCS08__ will be defined,
  if this option is set. The HCS08 architecture provides all addressing modes except
  SP16 for LDHX, dir, ext and SP8 for STHX, and dir, ext, imm16 and SP8 for CPHX.
- Following special macros are supported now in the environment too: {Compiler},
  {Project} and {System}. See manual for details.
  Note: Those macros are newly available during environment variable substitution.
  They are not automatically supported in filenames in general.
- Message C1069 is movable now (was error by default)
- New option -OnCstVar to switch OFF CONST variable by constant replacement. See
  manual/help file for details.
- The compiler option NoDebugInfo does now also support the HIWARE format.

List of fixed Bugs
- Rxxxx, wrong parameter passing to a call via function pointer with following
  definition:  void (*fptr)(int, char, int). This error occurred only with option cs08.
- R2743, the compiler generated a wrong dependency list for constructors with default
  arguments
- R2747, a crash occurs because the compiler was mistaken about the choice of the
  parameter or the class member when they have the same name
  Example :
  class A{
  public:
           A(int value);
  private:
           int value;
  };
  A::A(int value): value(value) {}

- R2719: wrong error message "unknown opcode operand combination" on address
  calculation with near pointer together with a constant in a singular case.
- R2696: wrong syntax tree was generated for such Ctor call ClassName::ClassName :
  member(new memberType){}
- R2689, wrong assumption by compiler on DIV instruction: E.g. 3000 % 10 raises an
  overflow and the modulus in the H register is indefinite (not 0). Now, a runtime
  routine is called. This routine performs the DIV too, but if carry is set (i.e. on quotient
  overflow), the operation is redone using the secure 16 x 16 bit division. The HC08
  simulator is corrected as well.
- R2681, C++: avoid assertion in error case.
- R2682, C++: wrong type checking for template class as return value.
- C++: Missed to take parenthesis in account at pointer to member initialization. For
  example:
  struct A{
    void fct(void){
      void (A::*ptrMbrFct)(void);
      ptrMbrFct=(&A::fct2);  // did generate an internal error
    }
    void fct2(void){}
  };
- R2650 : when the same function is declared twice or more in a C module with
  different prototypes, a warning is generated . For example :
  int Foo (char,float,int,int* );
  int Foo (char,float,int,int**  );

List of known Bugs
- None.


 RELEASE NOTES CHC08 V5.0.12 (ICG)
Note: These Release Notes contain some information about the C++ Compiler. If your
license configuration does not include the C++ feature, just ignore all topics related to C++.
NOTE: Recompile all your sources

List of new Features
- R2652: It is possible now to change the color for messages in the tool window. It can
  be changed for WARNING, INFORMATION, ERROR, FATAL and for user
  messages as well. Following options are available for this: -WmsgCW, -WmsgCI, -
  WmsgCE, -WmsgCF and -WmsgCU. See manual for details.
- New option -ShowAboutDialog to show the about dialog
- All tools have now a dialog to edit the environment (File->Configuration). E.g. to
  modify the GENPATH.  Note that this affects the project file only (and does NOT
  support the default.env)
- The binary has now splitted into an *.exe and a *.dll part. This allows it to use as
  CodeWarrior plug-in.
- The license file is searched in following order:
- license.dat in the directory where the executable is (this was already the case)
- hiware.lic in the directory where the executable is (this was already the case)
- license.dat in one directory up from the where the executable is (this is new. E.g. if
  the executable is in c:\metrowerks\prog, the license file in c:\metrowerks is searched
  too)
- the license file using the normal FLEXlm way (usually c:\flexlm, this was already
  the case)
- R2640: new option -BfaGapLimitBits to specify the maximum gap for bit field
  allocation crossing byte boundary
- The compiler defines now also following predefined define: __MWERKS__
- New warning message C1861 for illegal use of type void. See manual for details.
- R2578: implement simple C++ alternate cast syntax  e = T(e)
- R2627 long shifts in memory (e.g. x <<= 1): shifts with 1 are always inlined, for other
  shifts a shift loop is generated for optimize for time (ot) else a runtime routine is
  called (as before for all cases).
- 8 bit arithmetics on the index for indexed accesses to arrays smaller than 256 bytes.
  Former versions used 16 bit arithmetics.
- In the about box the most used environment variable settings are displayed too.
- New compiler option -NoPath to strip out path info out of the object files generated.
- R2517: gets() and puts() are now implemented in embedded.c. By default they use the
  terminal for input/output.
- R2566: The compiler generates warning message
  WARNING C1860: Pointer conversion: possible loss of data
  for cases where a pointer conversion may loose some data (e.g. a 16bit pointer is
  assigned to a 8bit pointer).
- ELF/DWARF: The compiler now uses the official register numbers in the DWARF
  debug info. But because of this change, the debug info of local variables on the stack
  and the call chain will only work when a new version of the debugger is used. While
  old versions of the debugger are used, the option -f2o provides the old behavior. File
  translated with -f2o however do not display the locals and call chain correctly on new
  versions of the debugger. Note: The behavior does affect the debug info only and not
  the correctness of the code.
- To switch off inlining completely, you can now specify -Oi=OFF. See manual for
  details.new option -AddIncl to include a header file using the command line. See
  manual/online help for details.
- new option -AddIncl to include a header file using the command line. See
  manual/online help for details.

List of fixed Bugs
- R2645: C++, error message was emitted when not necessary on pure virtual function
  call.
- R2651 internal error "Unknown Opcode Operand Combination" on pointer
  arithmetics with near pointers fixed.
- R2643 wrong code was generated for op-assigns on arrays indexed by a one bit
  bitfield (e.g. a[bf.i] += 2). bf.i was always taken as 0.
- C++ switch statement and initialization, compiler does not generate exotic error
  message on ignored case statement.
- Wrong type was generated in error cases (message C1859).
- R2634, R2636: friend static object are not member of the class in which they are
  declared.
- R2629: Common subexpression elimination for conditions did not check if
  indirections changed the values of the condition's operands. Workaround is option
  one or declare volatile the type of the indirection.
- R2625: Wrong message "WARNING C3803: Illegal segment attribute : data segment
  attribute not supported" for legal "#pragma CONST_SEG" pragmas fixed.
- R2621 H register was not killed after a MOV var,X+ instruction. The bug appeared
  when the value of X was 0xff.
- R2588 wrong addess arithmetics if the right opeand is a scaled char index and the left
  operand a pointer to a array with unknown size (external).
- R2584 register variable was reloaded with killed equivalent global variable in non
  linear control flow.
- R2568 common subexpression elimination for array accesses did not check the size of
  the base type and accessed the wrong byte (e.g. arr[i] = x;  ... (char) arr[i] did not load
  x)
- The name mangling for far/near/rom/uni pointers was not as described in the manual.
  The compiler has been changed to use the correct name mangling for it as described
  in the manual.
- R2569: fixed internal error for a long AND with 1 memory indirect operand with
  offset (pointer deref to a struct field p->field). This bug happened only with option -ot
- R2556: correction in the library routine for scanf: for %* the not assigned value was
  counted in the return value too.
- C like struct in C++:structures containing only data objects (no functions, no base
  classes, no hidden objects...) are now treated as C like structures.  This means they do
  not contains any compiler created functions (default copy constructor, default assign
  operator...). This way this kind of C Like struct can be union field. Example:
  struct myStructType{     // no compiler created function in this structure (C like
  structure)
    char  firstField;
    short secondField;
    int   thirdField;
  };
  union myUnionType{       // an union cannot contain any object containing a
  constructor
    int          firstUnionField;
    myStructType secondUnionField;
  };
- R2539: Internal error in glbreg.c fixed.
- R2501: correction for debug info for 8bit near pointer in HI-WAVE (size of pointer
  was displayed with a size of two), HIWARE format
- R2477: improved error message, implement a  missing pointer to member
  initialization way, when scanning '('check if type is really a function.
- R2464: if several paths were specified in the OBJPATH environment variables, this
  produced an error while creating the object file (fixed).

List of known Bugs
- None.


RELEASE NOTES CHC08 V5.0.11 (ICG)
Note: These Release Notes contain some information about the C++ Compiler. If your
license configuration does not include the C++ feature, just ignore all topics related to C++.
NOTE: Recompile all your sources

IMPORTANT: NEW COMPILER GENERATION (ICG)
  This compiler has a completely redesigned code generation back end using ICG
  (Intermediate Code Generator) technology. HIWARE is using this technology since years
  for other compilers. The ICG technology provides much more flexibility in code
  generation and may reduce code sizes for typical applications from 3-20%.
  Additionally, the need to reserve some space in the zero page is not necessary any more,
  and the runtime routines are full reentrant now.
  Actually, there are following points to be considered:

- Parameter passing is not compatible any more to V5.0.06. E.g. 2 byte parameters may
  be passed in registers. This is of importance if you are relying on the argument
  passing (e.g. passing parameters from the Compiler to the Assembler or back).
- The debug information has been adapted. To have the correct Debug in HI-WAVE,
  you need some new HI-WAVE V5.3 components in order to display the call chain
  and local variables correctly.
- The option Ca (7bit pointer difference) is not supported yet
- The option Cv (local variables of size 2 in _OVERLAP) is not supported yet
- The option Mb (banked memory model) is not supported yet
- Many HLI pseudo instructions are not supported yet (LDHX <ext>, _STACK, _ADJ).
- The HLI Assembler accepts now the original syntax for the MOV
  instruction
- 'MOV X+,dir'. The old notation 'MOV (0,X),dir' is not supported any more
- The HLI Assembler accepts now the original syntax of the DBNZ
  instruction, e.g. 'DBNZ X,rel' is now accepted instead 'DBNZ 0,X,rel'.
- The label-addressing mode is only supported yet for relative branches. E.g. "LDA
  label" or "JMP label" is not jet supported. But a "BRA label" is extended to a JMP if
  necessary, so it can replace a "JMP label".
- At the function end, the stack is not cleaned if modified by inline assembler. Inline
  assembler code should care itself to cleanup the used stack.
- In sub functions created by the common code optimization, the local variables are not
  correctly displayed. However, the first entry of the current function in the call chain
  does show the local variables correctly. So to view the local variables while being in a
  common code sub function, double click on the first entry of the current function in
  the procedure window of HI-WAVE.
- 2 byte accessed are always expanded in to 2 1 byte accesses (low byte first), if the
  code size of the 2 1 byte accesses is less or equal the code size of the 2 byte access.
  This may affect the semantics, if the access is volatile (e.g. access to 16 bit IO
  registers). It is recommended to code such volatile accesses in HLI.

List of new Features
- #pragma lines are now subject to macro replacement too.
  This makes it possible to conditionally set qualifiers for a segment macro, for
  example.
  Note: This may cause problems with the define NEAR =, which is contained in
  some hidef.h header files and the segment qualifier NEAR for a "#pragma
  DATA_SEG NEAR SEGNAME" (not all processors do support this qualifier).
  As solution to this problem, the compiler does now also support additionally to the
  existing qualifiers also __XXX_SEG, where XXX is for the old qualifier, e.g.
  __NEAR_SEG for NEAR.
  So the above pragma can be written as a "#pragma DATA_SEG __NEAR_SEG
  SEGNAME"
- R2395: the message C4437 writes now the reason for the #error directive too. For
  unknown directives (message C4440) the name of the unknown directive is written
  too.
- R2378: possible now to use nested scope local variables in HLI
- R2383: The option -Lasm does now provide more information about C++ member
  functions called
- New startup option NoEnv which allows skipping usage of project file (project.ini)
  and default environment file (default.env)
- The TopicName for the DDE communication supports now all the special modifiers
  (%f for file name, %l for line and %c for column) too. This is useful for DDE
  Communication with CodeWright from Premia.

List of fixed Bugs
- R2399: empty class had size of  1 byte plus alignment, evaluation of offset between
  two nested classes was wrong.
- R2393: initialization of pointer to member array was not implemented yet.
- Indirection operator '*' is illegal on Pointer To Member operands.
- R2410: Missing destructor call before large structure return fixed. The destructor is
  called now too.
- R2406: Bug in switch searchtable runtime support function
  "_Search_Table_16_Offset"
- R2018: when tag gets same ident string as obj and not declared in typedef then the
  wrong scope was taken. Scope of obj instead scope of type.
- R2354: array of pointer to function member was parsed as array of classes.
- R2373, R 2391: CMP #1; BNE <rel> to DBNZ <rel> optimization was done in a case
  where a flag set by the CMP was used by a following branch instruction (e.g. BNE).
  Now is't checked first if the flags written by the CMP are used afterwards.
- Avoid to generate wrong code which made the compiler looping in some error cases.
- R2369: allow to pass any array to a pointer to void during constructor initialization.
- R2364: Correction for the case where a local array of structs was initialized with a
  NULL array element. The problem was for a local initialization only. Example:
    void foo(void) {
    typedef struct {
      char *item_str;
      void (*p_item_f)(void);
    } fm_item_f_t;

    const  fm_item_f_t me_vehicle[] = {
     {"string",    NULL}, // without comma no internal error
     NULL // << this caused the problem. Workaround is to use {NULL, NULL }
    };
  }
- R2368: correction in C++ front end for the case where the left side of a virtual call
  this pointer evaluation is an complex array operation: a pointer to the first array
  element was passed to the virtual function instead of the pointer to the object itself.
  Example:
       this->arrayOfObjectPointers[i]->VirtualFunction();
    Workaround was to use a temporary variable.
- R2360: Missing spill of H register over a call to a switch table processor routine, that
  destroys the H register. This bug appeared only when the option -or was active.

List of known Bugs
- none


RELEASE NOTES CHC08 V5.0.10 (ICG)

List of new Features
- For the option -ObjN: if OBJPATH is not specified with the option (e.g. 
  ObjN=$(OBJPATH)\%n, the object file is stored where the source has been found.
  The library make files already have been adapted in this way.
- %(environment variable) can be used now for all options accepting special modifiers,
  e.g. ObjN=%(OBJPATH)\%n.o can be used.
- The option -ObjN allows more than simply the %n modifier. See manual for details.
- The options -Lm, -Li and -Lo do support now file names with spaces: they are written
  with double quotes. Additionally there is a new option LmCfg to configure the Lm
  option. See manual for details.
- Color for output is now used: e.g. error messages are written in red
- The option -ObjN uses now special modifiers too, thus the default is now -
  ObjN=%(OBJPATH)\%n.o. See manual about details.
- Now the compiler emits an error message if any interrupt routine is declared with
  return value or any parameter.
- The C++ compiler generates now error messages (C1444, C1445) when an
  initialization is skipped by 'case' or 'default' labels.
   Example:
     void main (void){
       int i;

       switch (i){
         int myVar = 4;
         case 0:         // C1444 cause init of myVar is skipped by this 'case' label
           break;
         default:        // C1445 cause init of myVar is skipped by this 'default' label
           break;
       }
     }
- R2315: Wish, inlining of more cases.

List of fixed Bugs
- R2350: CMP; BEQ to CBEQ optimization was done in a case where a flag set by the
  CMP was used by a following branch instruction (e.g. BNE). Now it's checked first if
  the flags written by the CMP are used afterwards.
- R2342: A buffer too small was used in embedded.c for the function scanf(). Now a
  buffer with size of  LIBDEF_SCANF_BUF_SIZE is used.
- R2343: fixing assertion in case of constant replacement optimization in the compiler,
  if the constant floating number array was initialized with integral numbers:
  const float zz[2]={0,1};
  void main(void){
    float a;
    a=zz[0];
  }
  Workaround was to initialize the array correctly with floating numbers: const float
  zz[2]={0.0f,1.0f};
- R2337, R2362: wrong array index calculation on non char zero page arrays together
  with a char index.
  Example:
    int arr[10];
    char idx, *ptr;
    ...
    ptr = (char *) (arr + idx);
- R2328: Explicit qualification in constructor initialization list was not possible.
  Example:
  class A {
    enum { val=0 } m_Enum;
    A(void) : m_Enum(A::val) {}
  };

- R2318: type qualifiers were not taken in account for 'new' operator parameter.
  Example:
      void fct(int param){
        char *p=(char *)new char[param];
      }

      compilation OK whereas

      void fct(int param){
        char *p=(char *)new unsigned char[param];
      }

      compilation failed !!
- R2308: all type specifiers were not taken in account for declaration in switch label.
- Scope of variable declared in switch case 'block' is limited to this 'block'.

List of known Bugs
- none


RELEASE NOTES CHC08 V5.0.9 (ICG)

List of new Features
- New -Lasmc suboption for no source prolog/epilog/function header:
  h: Do not write the function header
  p: Do not write the source prolog
  e: Do not write the source epilog
  v: Do not write the compiler version
- %c can be specified in editor configuration too to allow to open a editor with column
  information
- New function _itoa() in stddef.h which converts a integral value into a string.
  LIBDEF_StringPtr _itoa(int val, LIBDEF_StringPtr buf, int radix);
      /* writes an integral value as string into the buffer. Radix is the
         number base to be used, e.g. 10 (decimal). Returns always buf. */
- New warning message "C1857: Access out of range" which warns if there is an array
  access out of range.
    Example: char buf[3]; buf[3] = 0;
- Warning message C2705 warns now also about possible loss of data for assignments
  or argument passing.
  char c;
  long L;
  void foo(short);

  void main(void) {
    c = L; // possible lost of data
    foo(L); // possible lost of data
  }
- improved performance for constructor/destructors call in case of 1 element arrays, e.g.
   myClass *p = new myClass[1];
- new inlining of memset() and memcpy() using the -Oilib option. Additionally, there is
  now the message C5920 if a function has been inlined.
- For ELF, the official id assigned by SCO is now used. To use old tools, which only
  know the old id, with this compiler, use the option f2o instead of f2.
- The compiler now inlines such C++ examples:
   #define IO_REG (*((volatile unsigned int *) 0xFFC1C))
   struct IO_DEVICE{
     int receivedMessage(void){
       return IO_REG&0x0100;
     }
   };
   IO_DEVICE myDevice;
   void main(void){
     while(!myDevice.receivedMessage());
   }
- The compiler forgets Storage Class Specifier not applied on objects and generates a
  new warning message C1135. Example:
    static class A{
      public:
        int a;
    };
- R2103: New option  -WmsgNu to suppress user messages (e.g. included files). See
  manual/help file for details.
- R2105: The WARNING C4200: Other segment than in previous declaration is now
  also produced if the definition of a variable is in the default segment and the
  declaration was in another segment. Example:
    #pragma DATA_SEG ShortSeg
    extern unsigned char bCount;
    #pragma DATA_SEG DEFAULT
    unsigned char bCount;
  This may be dangerous if the default segment access method is a different one of the
  declared one.

List of fixed Bugs
- The startup code is now using 0xf0 and 0xf1 to load the stack-pointer. The previous
  usage of 0xfe and 0xff was not compatible with the MON08 onchip monitor, which is
  using the same memory area.
- Avoid internal error in compiler when initializing twice a pointer to member.
  Example:
   struct A{
               int i;
               int A::* ptr_mbr_int;
             }a;
             void main (void){
               a.ptr_mbr_int = &A::i;
               a.ptr_mbr_int = &A::i;
             }
- R2298: Missing optimization, not really a bug: (a op b) >> 8 was coded with a shift
  instead of getting the high part of the result.
- R2297: Wrong branch offset after low level branch tail merging in a singular case
  (increment of an int in memory) fixed.
- R2291: Crash after division by 0 in HLI after syntax error message fixed.
- Definition of nested class out of containing class scope was not implemented.
   class A{
     class B;
   }
   class A::B{};
- HLI instruction JMP <label> now supported (reestablished upwards compatibility
  from non ICG based HLI)
- Compiler handles access to static function member correctly now.
- Compiler handles access to members via nested classes
- This version contains an encryption support update. Encrypted files generated with
  the previous version of the compiler are not supported any more.
- R2239, R2314: wrong translation of int x+= const, if x is located in zero page and
  preloaded to register, fixed.
- R2212/R2260/R2261: virtual function call missing.
- R2212/R2260/R2261: pure virtual functions were inserted in the 'object to link' list
  even if they were not defined.
- R2172, R2213: wrong debug info for interrupt functions
- R2194: fixing possible stack overflow on host in TreeOptimizer for (!a&b) where
  both expression a and b were volatile and the result always was zero. Workaround
  was to use -Ont.
- R2191: Change the implementation of New and Delete operators, in the new.cpp
  library source file, to free the allocated memory.
- R2178: internal error in case of empty base classes with the -Cn=Ctr option sets.
- R2179: assertion when inlining a function dealing with static members.
- R2165: the message C1009 was not issued for a invalid struct redeclaration
- R2186: Loop unrolling was performed with global loop counters too. This is not done
  any more to avoid problems if the loop counter is used/modified outside the loop.
- R2162: The compiler handles static member functions in templates classes as well
  and generates corresponding code. Such functions were marked as not defined and
  then no code was generated.
- The compiler now generates an error message when a none static data member is
  accessed from a static function member.
- R2164: virtual function call was missing in case of call through a reference. Example:
  class A{
  public:
    A(void){ memberValue = 0; }
    int memberValue;
    virtual int getMemberValue(void){ return memberValue+1; }
  };
  ...
  class D{
  public:
    A &a;
    D(A &aC) : a(aC){}
    int getValue(void){ return a.getMemberValue(); }
  };
- C++: Static members have to be unique also in the "member list" of a class. Compiler
  generates now an error message (c1009).
   struct A{
     static int a;
     static int a;
   };
- C++: Local classes cannot contain any static data member. Compiler generates now
  an error message (c1134).
   void foo(void){
     struct A{
       static int a;            // ERROR cause static data member.
       static void myFct(void); // OK cause static function member.
     };
   }
- R2086: It was possible that the source position was wrong if the first character in the
  source was a newline only.
- R2089: For a combined assignment operation (e.g. |=) the casts on the right side of the
  assignment were ignored. Example:
  unsigned int a;
  unsigned char b;
  a |= (unsigned int)((unsigned char)(~b));

List of known Bugs
- The messages of the back end are not yet in the new error message format (e.g. C1234:
  ERROR message). The options -W1 and -W2 only affect messages in the new
  message format with the proceeding number
- Be careful with -Oc and aliases:
  The common subexpression elimination (option -Oc) cannot check for all cases if a
  memory location is referenced with several pointers, e.g. a pointer pointing to itself.


RELEASE NOTES CHC08 V5.0.8 (ICG)
Note: These Release Notes contain some information about the C++ Compiler. If your
license configuration does not include the C++ feature, just ignore all topics related to C++.
NOTE: Recompile all your sources

List of new Features
- R2082: It is now possible to use Assembler like syntax in HLI assembler, e.g. $12 is
  now equivalent to 0x12.
- C++: The compiler now accepts the following code without the message 'function like
  casting':
  void foo(void){
    int ((*p));    //multi level of useless parenthesis
    int ((f))(int);//multi level of useless parenthesis
  }
- R2031: the option does now also produce a listing file if there is no code generated
  (e.g. if the file contains only constants/variables).
- C++: It is now possible to inline STATIC (member or not) functions.
- The default implementation of printf, sprintf and the related functions is not reentrant.
  With the new define LIBDEF_REENTRANT_PRINTF in libdefs.h, the library can
  also be built with a reentrant, thread safe version of these function. These versions are
  larger and slower than the default, non-reentrant versions.
  To create a library with a reentrant version of sprintf/, change in the header file
  libdefs.h in the library include directory the define LIBDEF_REENTRANT_PRINTF
  from its default 0 to 1. Then rebuild the library.
- New options:
  -BfaTSRON: Enable Type Size Reduction for bitfield allocation.
  -BfaTSROFF: Disable Type Size Reduction for bitfield allocation.
  See manual/online pdf for details.
- Improved code for 'B.b1 = ~B.b1' and 'B.b1 = !B.b1' where b1 is a 1bit bit field.
- It is now possible to export (using a header file) a declared and defined at a specific
  address (using '@') object. For example:
  test.h --> extern volatile union{
                   struct{
                      unsigned char b0:4;
                      unsigned char b1:4;
                   }myBitfield;
                   unsigned char myChar;
                 }myUnion @0x09;

  test.c --> #include "test.h"

                 volatile union{
                   struct{
                     unsigned char b0:4;
                     unsigned char b1:4;
                   }myBitfield;
                   unsigned char myChar;
                 }myUnion @0x09;

                 void main(void){
                   ...
                 }
- Static Constant Integral Member initialization is now handled by the C++ compiler
- New option -F6 to produce V2.6 object files
- The entry
  #define MAXLINE      255 /* maximum buffer used for scanf() */
  has been removed from embedded.h, the entry
  #define LIBDEF_SCANF_BUF_SIZE         255 /* buffer size needed in scanf: may
  be reduced to save RAM */
  in libdefs.h is used instead. The libdefs.h header file is used to configure the ANSI
  library behavior and may be adapted by the customer.
- Many compiler limitations were increased by a factor of 65536. This includes the
  number of symbols in a file, the number of macros, strings and numbers.
- The new keyword __va_sizeof__ returns the size of the specified object/type on the
  stack when passed as open parameter. Therefore especially __va_sizeof__(char)
  returns sizeof(int) and __va_sizeof__(float) returns sizeof(double).
  With the keyword __va_sizeof__ it is possible to write stdarg macros which allow the
  usage of character variable in the va_arg macro. According to ANSI-C the behavior in
  this case is undefined.
  E.g.
  sizeof(char)           :  1 (unless otherwise configured
                               in the type size dialog)
  __alignof__(char[100]) : returns 1 (some targets also >1)
  __va_sizeof__(char)    : returns sizeof(int) because
                           characters are promoted to int
- New options -Ekey and -Eencrypt to deal with encrypted files. With this options it is
  possible to encrypt files and later to compile them without a need for the original
  source. See manual for details
- Demo limitation of 800 bytes of code has been increased to 1024 bytes of code
- New compiler define __DEMO_MODE__ if the compiler runs in demo mode
- Improved compilation speed for treeopt optimization

List of fixed Bugs
- R2088: condition not swapped for on-the-fly optimization -a < -b  ---> a > b.
- R2036: C++: Inlined constructor with initialization passing is now STATIC and not
  exported any more.
  Example:
    struct A{
      int a;
      void A(int *pa){ a=*pa; }
    };
    struct B : public A{
      void B(int *pa) : A(pa){} // pass initialization value to the base class constructor
    };                          // here the B constructor was exported.
- R1988: correction for assertion in front end if there is no actual function object while
  compiling a C++ file
- R1994: tree optimizer did optimize statements if there was a cast on the root of a
  statement: the statements after were optimized. Example: (char)buf[3]++; i++;
  Workaround was to specify -Ont.
  - Do not generate a NULL check pointer if delta is 0 in the following cast expression:
    class A{
      //...
    };

    class B{
      //...
    };

    class C : public A, public B{
      //...
    };

    void main(void){
      C *pc = new C;
      B *pb;
      A *pa;

      pb = pc; // this assignment will be interpreted as pb=(B*)((char*)pc+delta(B));
               // Here delta is different from 0. In case of pc is NULL, pb has to
               // become NULL as well. That's why one has to generate the following code
               // pb = (pc==0) ? 0 : (B*)((char*)pc+delta(B));

      pa = pc; // but here delta is 0, then generating such code is useless:
               // pa = (pc==0) ? 0 : (A*)((char*)pc+delta(A));
    }

    class C object memory layout:
           pc and pa ---> +-----------+   +
                          |   A part  |   | delta(B)
                  pb ---> +-----------+   +
                          |   B part  |
                          +-----------+
                          |   C part  |
                          +-----------+

- Generate the following error message "Invalid redeclaration of enum type" only if it is
  really a enum type redefinition and not for example a function's return type.
- Generate information about interrupt function even in case of class member functions.
  Such a definition
  interrupt 5 void my_class::f(void) { };
  is supported now.
- Avoid compiler assertion in error cases when using the cC++ language without any
  Constructor
- In case of a sign extension with a question mark operator, the sign extension was
  moved after the evaluation of the question mark operator. But for statements after the
  operator, the statements afterwards were ignored. The workaround was to use the
  option -Ont. Example: (cond) ? (int)(ch1=0) : (int)(ch1=1); Note: The problem has
  exist only if the '?' operator was used in a statement.
- Avoid compiler assertion in error cases when using the cC++ language without any
  Constructor
- In case of a sign extension with a question mark operator, the sign extension was
  moved after the evaluation of the question mark operator. But for statements after the
  operator, the statements afterwards were ignored. The workaround was to use the
  option -Ont. Example: (cond) ? (int)(ch1=0) : (int)(ch1=1); Note: The problem has
  exist only if the '?' operator was used in a statement.
- Internal error fixed for function parameter zero extended from char to long. The error
  appeared only if the constant 0 is used frequently in the context of the function call.
- Internal error fixed for unused expression with volatile access to a field of a structure.
  Example:  s.f == 1;
  The error did only occur for structure field accesses with objects declared volatile and
  others not. (e.g. volatile struct { int f;} s; s.f; ---> internal error, volatile struct
  {volatile int f;} s; s.f; ---> ok).
- The Peephole optimization "-onp=k" did not treat the case of a unsigned compare
  with 0 for the greater, smaller case correctly. This case did only happen when the tree
  optimizer was switched off "-ont".
- Combined assignments on a constant pointer dereferenced location did generate an
  additional nonsense MOV <loc>, <loc> instruction, if the location is declared as
  'volatile'. Example:
  (*((char *)0x21)) &= 1;
- Missing qualification at C++ constructor call corrected.
- Volatile assignments, which can be handles by a memory operation, did produce a not
  necessary load/store or move instruction.
- Address relocation for a INC in the zero page corrected. Example: PTD++ if PTD is
  located int the zero page. corrected in V5.0.07a.
- After include directives with a macro name for the filename, the line numbers were
  sometimes wrong.
- De-referenced pure virtual function calls are correctly handled now.
  class A {
  public:
    virtual int f(void) = 0;
  };

  class B : public A {
  public:
    int f(void){ return 6; }
  };

  static void test1(void){
    B b;
    A* pa= &b;
    if (pa->f() != 6) {
      Err(1);
    }
  }
- Static member access correctly handled now.
  class A {
  public:
    static int b;
  };

  int A::b=9;

  class C {
  public:
    static int retSum(void){ return A::b; };
  };
- Pre-processor handles following examples in the right way now:
- C++ comments:
  #define VALUE /##/
  VALUE blablablabla
  - Missing parameter:
  #define fct(A, B) int A B

  void main(void){
    fct(i, );
  }
- Expansion troubles:
  #define m(a)    a(w)
  #define w       0,1

  m(m);

List of known Bugs
- The messages of the back end are not yet in the new error message format (e.g. C1234:
  ERROR message). The options -W1 and -W2 only affect messages in the new
  message format with the proceeding number
- Be careful with -Oc and aliases:
  The common subexpression elimination (option -Oc) cannot check for all cases if a
  memory location is referenced with several pointers, e.g. a pointer pointing to itself.


RELEASE NOTES CHC08 V5.0.7 (ICG)
Note: These Release Notes contain some information about the C++ Compiler. If your
license configuration does not include the C++ feature, just ignore all topics related to C++.
NOTE: Recompile all your sources

List of new Features
- Because the result of casting a (signed) floating value to a unsigned integral value is
  undefined in ANSI-C, there is now a warning message for that (C5919, see also
  manual).
- There is now a -View option which allows to specify if the application window runs
  as normal window, full screen, minimized, maximized or hidden. See manual for
  details.
- The Compiler has now a new icon, so it is much easier now to identify the Compiler
  if the window is minimized in the task bar.
- The -Oilib option to inline ANSI library function has been extended. It is always a
  good thing to set this option if you don't want to implement your own library
  functions, because it increases the code speed, and in many cases it also reduces the
  code size.
- various compiler limitations has been extended and refined. See also Manual
  "Translation Limitations" for details.
- maximum recursive expansion level has been increased from 70 (16bit OS) to 2048
  (32bit OS). See also message C4412.
- maximum number of macro parameters has been increased from 1000 to 1024. See
  also message C4428.
- Nesting levels for#include files has been increased from 32 to 256. See also message
  C3000.
- better error handling in case of a preprocessor error.
- the previous declaration of fabs in math.h
      #ifdef __OPTIMIZE_FOR_TIME__ /* use inline version */
        #define fabs(d)  ((d)>=0.0  ? (d) : -(d))
        #define fabsf(f) ((f)>=0.0F ? (f) : -(f))
      #else
        extern double fabs(double);     /* absolute value */
        extern float  fabsf(float);     /* absolute value */
      #endif
    has been replaced with
      extern double fabs(double);     /* absolute value */
      extern float  fabsf(float);     /* absolute value */
    that is the macro version has been removed. The reason is that using a macro may be
  a dangerous thing:
      d = double(d++); // d++ is evaluated twice using a macro
  To get the same optimal code, the -Oilib option provides an option to inline fabs and
  fabs (see manual for details).
- The library now contains startup.h and startup.c: this is a generic startup code written
  in C you can use and adapt. Note: for code efficiency reasons it is recommended to
  use still the startup code written in HLI.
- The library now includes also following files (which were present in the demo
  directory previously:
    - inout.h, inout.c
    - terminal.h, terminal.c
    - termio.h, termio.c
  If you want to use your own terminal interface, just adapt the termio.c and link it in
  front of the ansi library to replace the version in the library.
  Additionally there is
    - embedded.h, embedded.c
    which is an interface to ressources normally not available on an embedded target.
  This interface is for simulation only and contains the implementation of following
  functions:
    - fopen()
    - fflush()
    - fclose()
    - fprintf()
    - fputs()
    - fputc()
    - printf()
    - scanf()
    - clock()
    - abort()
    - exit()
- Previously the heap in heap.c was initialized during copy down (static initialization).
  This approach has used depending on the heap size a lot of ROM. The initialization is
  done now during the first malloc, requiring only 1 byte of RAM.
- There is now a warning C3804 if a predefined segment name is used, e.g. #pragma
  CONST_SEG ROM_VAR, because this may raise conflicts during linking
- For redefinition of an existing macro, the position information of the previous macro
  definition is also provided.
- The number of errors, warnings and information messages is now reported at the end.
  Additionally, if more than one file is specified on the command line, the processing
  does not stop any more on the first error file. It tries to process now all the files
  specified and reports at the end the total number of errors, warnings and information
  messages.
- Improved floating point performance for addition, subtraction, multiplication and
  division: operations are performed on single precision arithmetic if possible
- Improved comparison optimization: the compiler folds sequences of comparisons into
  or operations or backwards into comparisons if better, e.g. 'a == 0 && b == 0' may be
  more optimal written as '(a|b)==0'.
- The -OiLib option allows now also inlining of strlen if the string is constant, e.g.
  using -OiLib, 'strlen("01")' will be directly replaced by '2'. You can use '-OiLib=b' to
  switch this off.
- The compiler defines now the macro __MODULO_IS_POSITIV__ if the result of the
  modulo operation is always positive (e.g. for a M68HC11 CPU). In ANSI-C the result
  of (-22%4) can be either 6 or -1. If it is 6, then the macro
  __MODULO_IS_POSITIV__ is defined. This helps to write portable code across
  different platforms (see manual for details).
- Unary Operator (__alignof__(type-name)):
  Some processors require aligning objects according to their type. This unary operator
  can be used to determine the alignment for a specific type. By providing any type, this
  operator returns the corresponding type alignment. This operator behaves in the same
  way as "sizeof(type-name)" operator. See target back-end section to check which
  alignment corresponds to which Fundamental Data Type (if any is required). This
  operator may be useful for the va_arg macro in stdarg.h, e.g. the alignment of a
  structure containing 4 objects of 4 bytes and the one of a structure containing 2
  objects of 8 bytes are different and the size of those structures are the same:
    #define va_arg(ap,type)    \
      (((__alignof__(type)>=8) ? \
       ((ap) = (char *)(((int)(ap) \
       + __alignof__(type) - 1) & \
    (~(__alignof__(type) - 1))))\
        : 0), \
      ((ap) += __va_rounded_size(type)),\
      (((type *) (ap))[-1]))
- If the options -Li, -Lm or -Lo are specified, code is generated too.
  Previously no code was generated if one of these options was specified (as
  stated in the manual).
- It is possible now to 'brace' the -OdocF option using '(' ')', '"' '"', '[' ']', '{' '}'. If no
  spaces are used between the option, braces are not necessary. Examples:
  -OdocF="-Cni|-Or"
  -OdocF=-Cni|-Or
  -OdocF=(-Cni|-Or)
  -OdocF=[-Cni|-Or]
  -OdocF={-Cni|-Or}
- Following special case is handled yet: for 'int arr[25];' 'sizeof(0,arr)' is now the same
  as sizeof(&arr[0]), whereas 'sizeof(arr)' is '25*sizeof(int)'.
- The compiler implements now the #line directive
- strxfrm() and strcoll() implemented in the string library
- C++ comments are not allowed any more if the compiler options -Ansi is set. Of
  course they are allowed for C++ source files. To enable C++ comments ('//') even if -
  Ansi is set, you have to specify the -Cppc option.
- The asm is not allowed any more if the Ansi (strict ANSI) is specified. The reason is
  to be compliant with ANSI rules tested by independent test suites. E.g.
  int asm; // allowed in ANSI-C
  has to be allowed if Ansi is set, thus 'asm' cannot be a keyword. You will encounter
  error messages if you try to compile sources with Ansi which contain 'asm'
  keywords. Nevertheless, you can use __asm instead asm:
  __asm {.
- For all non ANSI keywords as "far", "near", "interrupt", "paged", "uni", "rom" and
  "asm" there is now an additional from with two leading underscores ("__far" for
  "far,.. ).
  The version with the underscores is available even when the option "-Ansi" is
  specified. The old style form is not present with "Ansi".
  Note: Not all keywords are supported in all targets.
- For HLI blocks ('asm { ...'), sometimes an error message was displayed for the next
  line and not for the line where the error occurs. This has been improved, so the error
  message is displayed now on the correct source line.
- The compiler can now handle switch expression over long variables.

List of fixed Bugs
- Actually unused strings are no longer writen into the object file. With the ELF object
  file format or with the new HIWARE linker, these strings were allocated when smart
  linking was explicitly switched off.
  Example :
  const char buf[100]="Buffer".
- Correction for the HIWARE object file format were the object list in the object file
  was written twice. This had no effect on the tools, but had increased the object file
  size.
- Following initialization was allowed:
  Typedef union myUnion_t{
    int a;
    char b
  }myUnion;
  myUnion obj=3;
  whereas curly braces are missing (now C2206 error message is generated).
- Pre-processor handles following example in the right way now:
  #define STR(a) NXSTR(a)
  #define NXSTR(a) #a
  #define f h
  #define h(a) a+f

  char *p0 = STR( f(1)(2) );
  /* the result has to be "1+f(2)" or "1+h(2)" and not "h(1)(2)" */
- Pre-processor handles following example in the right way now:
  #define STRING_A(s) #s
  #define CAT1(a, b, c) STRING_A(a) STRING_A(b) STRING_A(c)

  #define FIRST Hicross+
  #define SECOND From
  #define THIRD Hiware

  static char *b = CAT1(FIRST,SECOND,THIRD);

/* result has to be "Hicross+FromHiware" */
- In pre-processor: '.' ## "string" is a legal concatenation now.
- Default argument placeholder functions have not to be taken in account as virtual
  functions.
- Some temporary files were not deleted in some specific error cases.
  The temporary files are named "~tmp1", "~tmp2" and so one. They are located in the
  system temporary directory. To find the system temporary directory, open a dos box
  and enter "echo %TMP%" and hit return.
- Hexadecimal and octal escape sequences do behave differently.
  A hexadecimal escape sequence does no end for the first non-hex digit. Octal escape
  sequences are ending at the first non-octal digit or after at most 3 octal digits.
  E.g. "\x0102" issues now the error "ERROR C4418: Illegal escape sequence", while
  previous versions did recognize "\x010" "2".
- Duplicated virtual functions into virtual tables.
- Constant accesses to constant arrays of structures were not only correctly handled.
  The wrong constant was returned.
  In the example, main did incorrectly return 2 instead of 4.
  struct A {
    char a;
    char b;
  };
  const struct A arr[2] = {
    {1,2},
    {3,4}
  };

  int main(void) {
    return arr[1].b;
  }
- Line continuations may now also occur inside of identifiers
- When after the backward slash a space is following, this is no longer treated as line
  continuation. Remove the space if you want a line continuation.
- Correction for calloc: the memory was not initialized correctly
- The treeopt optimizer did incorrectly remove switches with a constant switch
  condition, which was only satisfied by a default label.
  Example :
    void main(void) {
        switch(10) {
         case 1: ...
         case 9: ...
         case 11: ...
          default: .... /* this code was not executed */
      }
  }
- Implicit initialization of floating point values in local structures or arrays did raise an
  internal error. This problem did only occur under the following conditions :
- local variable to be initialized
- not all floating point values were explicitly given
  Example :
    void main(void) {
    float f[2]= {1.1};
  }
- The type character "%p" in <scanf> function family requests now the correct type
  which is a pointer to a pointer to character (char **) instead of a pointer to a
  character (char *).
  The optional prefix to type 'L' which specified the size (long) of a type character,
  requests now a long for "%Ld" and "%Li" instead of an integer in <scanf> function
  family.
- Absolute objects (e.g. int i@ 0x1000) do now work correctly.
- Wrong stack offsets of local variables in interrupt handlers having function calls fixed.
- Unused accesses to volatile objects were optimized illegally. Now a load is always
  done to guarantee the side effect.

  Example:

  volatile char ch;

  void main(void) {
      ch;         /* ch has to be loaded into a register (ANSI) */
  }
- The compiler did not recognize all illegal implicit casts in C++ from or to void*.
  Now they give an error message.
  Example
  void * pv;
  int i;
  void main(void) {
    pv=i; // now gives an error message when using C++
          //and a Warning in C
  }
- The compiler accepts now functions used in complex comma expressions:
  fktPtr = (expr, function);
- Correct code is generated now for following example:
  char *p;
  *p++ |= 1;  /* set bit #1 */

List of known Bugs
- The messages of the back end are not yet in the new error message format (e.g. C1234:
  ERROR message). The options -W1 and -W2 only affect messages in the new
  message format with the proceeding number
- Be careful with -Oc and aliases:
  The common subexpression elimination (option -Oc) cannot check for all cases if a
  memory location is referenced with several pointers, e.g. a pointer pointing to itself.
- or a source file is compiled.



RELEASE NOTES CHC08 V5.0.6
Note: These Release Notes contain some information about the C++ Compiler. If your
license configuration does not include the C++ feature, just ignore all topics related to C++.
NOTE: Recompile all your sources

List of new Features
- The global and local editor can now be configured also in this tool and not only with
  the shell.
  Note:
  - The global editor is stored globally in the mcutools.ini. The same editor
    configuration is used by all tools (decoder, compiler, assembler,....).
    Changes to the global mcutools.ini are stored when the application is closed and not
    when the save command is chosen from the menu.
  -The local editor is shared among all tools using the same project file (usually
    project.ini).
  - Which editor type is used is stored in the project file. The default is the global
    editor.
- The compiler optimizes now for loops into do..while loops if the code is more
  compact. This results in faster code too.
- All error messages are now written to stdout. With WinEdit, the 'Capture Output'
  features in the Project->Configure dialog can be used to get the error feedback. In
  other applications as Microsoft Visual C++ Developer Studio (MSDEV) or the
  cmd.exe command shell, it is necessary to use the new launcher application
  'piper.exe' to get direct error feedback. The compiler is a Win32 Window application
  and this type of application is not expected to have reasonable output. Therefore, the
  command shell 'cmd.exe' or MSDEV do not use the stdout file.
  The 'piper.exe' tool is actually a Win32 command line application and therefore
  MSDEV or 'cmd.exe' use the stdout.
  The first argument of 'piper.exe' is used as application to be called with the
  remaining options. The output of the started application is then written to standard
  output.
  To print the list of option in a command window use:
  (instead of tool use the compiler/linker/... name).
    piper.exe tool.exe -h

- If there is a nameless struct or union (e.g. typedef struct _tagStruct { int a; };), now
  the tag name is written to the object file too for better debugging support.
  Additionally there is extended debugging support for enumerations, that means for the
  following source debug information is available for the enumeration values RED,
  GREEN, BLUE, WOOD, STONE, IRON and MARBLE:
    enum Color_tag { RED, GREEN, BLUE} Colors;
    enum Color_tag taged_color;
    typedef enum Material_tag { WOOD, STONE, IRON, MARBLE} Materials;
    enum Material_tag taged_material;
    Materials material;

List of fixed Bugs
- Register trace bug in following pseudo source code example fixed:
  if(ch > val1) {
     ch++;
  }
if(ch != val2)   ? ch was not reloaded due to the conditional change ch++

- Accesses via indirections to volatile memory (e.g. constant pointer deref. like
  *((volatile char *) 0x200) were optimized in some cases. This is fixed
  and cannot happen anymore.

List of known Bugs
- Absolute objects do not work correctly.
  The compiler adds the address twice, so it accesses an absolute object at address
  0x1000 at address 0x2000. Do not use absolute objects.
- Volatile accesses are sometimes optimized by the compiler.
- The compiler cannot handle switch expression over long variables.
  Workaround: use if-else if-else
    Example:
  unsigned long uL;
  unsigned int ui;

  switch(uL) {
    case 0: ui = 1; break;
    case 1: ui = 10; break;
    default: ui = 0; break;
  }
  produces an error message, so the above statement has to be rewritten with an if-else
  if-else:
  unsigned long uL;
  unsigned int ui;

  if (uL == 0) {
    ui = 1;
  } else if (uL == 1) {
    ui = 10;
  } else {
    ui = 0;
  }
- The messages of the back end are not yet in the new error message format (e.g. C1234:
  ERROR message). The options -W1 and -W2 only affect messages in the new
  message format with the proceeding number
- The -OdocF option does not care about illegal option combinations (e.g. mixing
  memory models).
- Be careful with -Oc and aliases:
  The common subexpression elimination (option -Oc) cannot check for all cases if a
  memory location is referenced with several pointers, e.g. a pointer pointing to itself.
- Incorrect code is generated for following example:
  char *p;
  *p++ |= 1;  /* set bit #1 */
      workaround:
  char *p;
  *p |= 1;
  p++;
- Preprocessor directive #line not implemented, the directive is ignored.


RELEASE NOTES CHC08 V5.0.6 beta5
Note: These Release Notes contain some information about the C++ Compiler. If your
license configuration does not include the C++ feature, just ignore all topics related to C++.
NOTE: Recompile all your sources

List of new Features
- New option -LicA to display license information about every possible feature in the
  directory where the executable is. Note: this option requires some time to get all
  features out of every file in the directory and may take a long time
- PC only: This version is a true 32bit version only, it cannot run under Win32s any
  more. If you are still using Win32s, either upgrade to Windows 95 or WinNT 4.0. If
  this is not possible, please contact us. The reasons not to support Win32s any more:
- Most hardware vendors do not support their chips with Win32s tools any more, thus
  if we support such target interfaces, it is not possible to run our tools under Win32s
- Microsoft does not support 16bit applications nor Win32s
- Using a lot of graphical user interface (as in HI-WAVE), Win32s is quite instable,
  e.g. some dialog boxes may behave differently in Win32s than in a true Win32
  environment
  The 32bit application needs two additional dll's which are copied to your Windows
  system directory: mfc42.dll and msvcrt.dll
- This version introduces the FLEXlm license managment which allows a very flexible
  licensing (PC only):
- floating licenses (client-server)
- node locked licenses (single workstation)
- dongle optional
  Running a tool without any license manager switches the tool to a restricted demo
  mode (see 'Demo Version Limitations' below). The about box gives an overview with
  the current host id and the status of each feature/license. The license manager consists
  of following parts:
- the license manager dll 'lmgr326a.dll': this license dll is normally installed where the
  tools are (default c:\hiware\prog\lmgr326a.dll'), but it is also possible to place this dll
  into the Windows system directory or wherever your operating system searches for a
  dll.
- the license file. The name of the license file is either 'hiware.lic' or 'license.dat'. This
  file is a normal text file and normally placed into the same directory as your tools are
  installed, usually 'c:\hiware\prog'. This license file contains all features enabled on
  your site, everything else without a license is in a restricted demo mode. If you do not
  have a license yet, you can request one sending us the content of the about box to
  'register@hiware.com'.
- The option -Lp (preprocessor output) accepts now an optional file specification, e.g. -
  Lp=%n.pre (see manual for details) (which is also the default). The TEXTPATH
  environment variable is used if the preprocessor output file name does not contain a
  path (NOTE: a relative path is a path too!).
- The compiler exists now in two forms :
- with graphical user interface : chc08.exe
- with command line user interface : cchc08.exe
  The cchc08.exe is a Win32 command line application and can only be run on true
  Win32 systems  Windows NT or Windows 95 or higher, but not in Win32s.
  The command line version of the compiler does not use the project.ini in any way.
  Options must be given on the command line (recommended) or in the
  COMPOPTIONS entry in default.env.
- Filename may be surrounded by double quotes. Then filenames and paths may also
  contain spaces.
- The new option -la generates a listing file, which then can be read by the assembler.
  This way, the information in C header file gets accessible by assembler modules.
- With the new option -lasm the compiler itself generates a listing file.
  Note : In the current beta version, the assembly output module is not jet completely
  finished and is still subject to changes.
- New option -NoBeep to disable the beep in case of an error.
- It is now possible to redirect the message output to a file if a tool is started using a
  command shell. Example: 'c:\hiware\prog\linker.exe fibo.prm > output.txt'. NOTE: if
  a tool launched by a command shell under Win95, you have to add '/wait' to the start
  command if the shell has to wait until the started application terminates, e.g. 'start
  /wait c:\hiware\prog\linker.exe fibo.prm'.
- New warning message 'C1805: Non standard conversion used' if a object pointer (e.g.
  a pointer to a struct) is  assigned to a function pointer. Previously there was an error
  message 'C1806: illegal cast operation' for this case.
- It is now possible to check in the source if an option is active. The EBNF grammar is
  OptionActive = "__OPTION_ACTIVE__" "(" string ")".
  It can be used in the preprocessor and in C code too:
  #if __OPTION_ACTIVE__("-W2")
    // option -W2 is set
  #endif

  void main(void) {
    int i;
    if (__OPTION_ACTIVE__("-or")) {
      i=2;
    }
  }
- New virtual function management: avoid to create virtual table pointer when it is
  possible (less virtual tables, less code).
- New option -Lic to display license information (note: this information is also displayed
  in the about box)
- New defines __LITTLE_ENDIAN__ and __BIG_ENDIAN__ to identify the data
  allocation. See manual for details.
- New option -Ldf to write all compiler defined defines to a file (see manual for details).
- New options -WmsgFoi and -WmsgFob to specify message format for batch and
  interactive format. This options are using a format string for a flexible message format.
- The compiler tries to use integral compares instead double compares now whenever
  possible. This reduces usage of runtime libraries and increases code speed. The option
  -Ont may be used to switch this optimization off.
- The -Ont option does have now suboptions to disable single optimizations.
- C++ libraries STL, "complex", "bitset", "strstream" added.
- Bitfields inside unions are legal
  Example:
  struct {
    union {
      char ch : 1;  // legal !
    } u;
  } S;
- New options -CswMinLF, -CswMaxLF, -CswMinLB to configure switch processor
  behavior (HI-CROSS+ only), see manual for details.
- New macro __VERSION__ to identify compiler version. E.g. for a compiler V5.0.2
  the value of the macro is 5002, for a compiler with version V3.0.17 it is 3017.
- Functions containing function calls and/or loops inside can now be inlined, too !
- Global variable address modifier
  Global variables can be put to specific addresses with the global variable address
  modifier. It has following syntax:
  Declaration =
  <TypeSpec><Declarator>[@ <Address>][=<Initializer>];
    Example:
  int glob @0xff02;  // variable "glob" lies at 0xff02
- New option -ObjN to specify the object file name, default is "-ObjN=%n.o". This
  option allows changing the default object file name which is normally the source file
  name with extension ".o". E.g. to specify the extension ".obj" for the object files
  generated by the compiler, the option "-ObjN=%n.obj" may be specified (see manual
  for details).
- New option -Wmsg8x3 (PC only): This option truncates the file names in the message
  log file to the MS-DOS format (8.3 format). E.g. if this option is set and the source file
  is named 'mysourcefile.c', the source file referenced in the message output is
  'mysource.c'. This was the default behavior in earlier versions, because some editors
  (e.g. very old versions of WinEdit) do have problems with file names larger than 8.3
  format. The default is not to truncate the source file name in the message output.
- Local static variables can now be qualified, too !
  Example:
  void f() {
    static int far i;
  }
- The number of pragmas active at the same time is no longer artificially limited.
- The new pragma MESSAGE can be used to set messages to a certain kind. E.g. to set
  the message 'Implicit Function Definition' to an error.
- The new pragma OPTION can be used to enable certain options for some functions
  only. E.g. to enable -cni during one time critical function.
- Characters with ACSII code larger than 0x7f were treated from previous compiler
  versions as white space characters (like a space). This compiler version no emits an
  error.
- Characters with ACSII code larger than 0x7f were treated from previous compiler
  versions as white space characters (like a space). This compiler version no emits an
  error.
- The new pragma STRING_SEG or STRING_SECTION allows the allocation of all
  following strings into a specific segment. Strings put into a named segment are
  handled by the linker like constants. The string segment pragma must also contain
  modifiers like "SHORT" as any other segment pragmas if the strings are allocated in a
  non default way.
  Example:
  The strings "Print %s", "Print" and "str" are allocated in the segment MY_STRINGS.

  #pragma STRING_SEG MY_STRINGS
  void main(void) {
    printf("Print %s", "Print");
  }

  char* str="str";

  #pragma STRING_SEG DEFAULT
- the HICROSS +compilers do now also support the directory searching feature for
  environment variables.
  The compiler finds include files included with <> (#include <test.h>) in the directory
  c:\hicross\work and all its subdirectory and in the directory c:\hicross\lib with the
  following entry in default.env :
    LIBPATH=*c:\hicross\work;c:\hicross\lib

List of fixed Bugs
- correction for CSE problem (compiler option -Oc): The compiler has produced wrong
  code for the following complex example:
  static void test(STRUCT1 *ptr) {
    if (Array[ptr->byte1] > (structArray[ptr->byte2].byte4
         + structArray[ptr->byte2].byte3))
    {
      Array[ptr->byte1] -= structArray[ptr->byte2].byte3;
    } else {
      Array[ptr->byte1] = 0;
    }
  }
- The manual described the option "-prod" to expect a "=" and then a filename. But the
  implementation did expect the filename after a space. The new implementation now
  follows the manual description
  -prod=c:\hicross\demo\project.ini
- Template class with multiple inheritance having base classes generated of same
  template and Constructors calling base class Constructors corrected !
  Example:
     template <class T> class foo {
        public: foo(char l) {};
     };
     template <class T> class hoo : public foo<T>, foo2<int> {
        public : hoo(char id, char dir) : foo<int>(1), foo<T>(2) {};
     };
     hoo<char> P(1,2);
- Avoid to generate a virtual function call where it was not necessary.
- Inline assembly comments could produce an error, if illegal numbers were written.
  Now they are skipped correctly by the parser.
- If no messages are generated, an empty error/message file is generated now.
  Previously there was no error file if the compiler did not issue a message. This caused
  problems with the Codewright editor which expects always a message file, even if
  there are no messages.
- Referencing an array-type member of a struct at constant address generates now
  correct code.
  Example:
    struct A {
      struct {
        char buf[2];
      } ar[4];
    };
    char ch;
    void main() {
      ch=(char)(&((struct A*)0x00)->ar[1]);
    }
- C++ Constructor call at "new" operator call with array of inherited class assigned to a
  pointer to base class.
    Example:
      class A {
        A();
      };
      class B : A {
        B();
      };
      void f(void) {
        A *a = new B[5];  // now generating correct Constructor calls !
      }
- Arrays first defined and then declared did not work correctly.
  With the ELF object file format, a compiler internal error in the elf.c module was
  reported. In the HICROSS object file format, the object was only declared, but not
  defined, so the linker did issue a error message.
  Example:
    char a??="Example";
    extern char a??;
    This bug did occur only in the following cases :
     - first a definition and then a declaration (reverse order of the usual case)
     - only for arrays
     - array was declared without the array size (not in the form "extern char a?8?;")
- Odocf Problem: when starting the compiler from the command line or from the
  maker, the -odocf was ignored until now when the double quotes (") were not
  escaped. E.g. compiler.exe b.c -odocf="-or" did never use -or. The reason is that
  command.com does only forward the following to the compiler: 'compiler.exe b.c -
  odocf=-or' And -odocf=-or was ignored. Now this is an error. Especially all makefiles
  using odocf will no work until the double quotes were escaped correctly. E.g.
  compiler.exe b.c -odocf=\"-or\"
- Indirection of address of constant variable is a lvalue !
  Example:
  const int i;
  void f(void) {
    *(int *)&i=2; // legal !!
  }
- Compiler endless loop for the statement
     for(;;);
  fixed.
- Inconsistency problem for interrupt functions (with interrupt keyword) having a
  prototype without interrupt keyword solved (i.e. the interrupt function has now a
  RTI).
- Parameter passing problem for function with more than 2 parameters (one
  parameter in register) solved (stack was incorrect)
- Compiler did optimize away an inline assembler instruction that made sense.
  Compiler did optimize the code for a compare without branch which is incorrect if
  there are side effects like assignments and function calls. Now, the code for
  compares will not be removed anymore
  Example:
  The assignment ch = 0 was removed
  char ch;
  void f(void)
    if(ch = 0);
  }

List of known Bugs
- Absolute objects do not work correctly.
  The compiler adds the address twice, so it accesses an absolute object at address
  0x1000 at address 0x2000. Do not use absolute objects.
- Volatile accesses are sometimes optimized by the compiler.
- The compiler cannot handle switch expression over long variables.
  Workaround: use if-else if-else
    Example:
  unsigned long uL;
  unsigned int ui;

  switch(uL) {
    case 0: ui = 1; break;
    case 1: ui = 10; break;
    default: ui = 0; break;
  }
  produces an error message, so the above statement has to be rewritten with an if-else
  if-else:
  unsigned long uL;
  unsigned int ui;

  if (uL == 0) {
    ui = 1;
  } else if (uL == 1) {
    ui = 10;
  } else {
    ui = 0;
  }
- The messages of the back end are not yet in the new error message format (e.g. C1234:
  ERROR message). The options -W1 and -W2 only affect messages in the new
  message format with the proceeding number
- The -OdocF option does not care about illegal option combinations (e.g. mixing
  memory models). [Note: The -OdocF option (OptiHunter(tm)) is only available
  with a special license].
- Be careful with -Oc and aliases:
  The common subexpression elimination (option -Oc) cannot check for all cases if a
  memory location is referenced with several pointers, e.g. a pointer pointing to itself.
- Incorrect code is generated for following example:
  char *p;
  *p++ |= 1;  /* set bit #1 */
      workaround:
  char *p;
  *p |= 1;
  p++;



RELEASE NOTES CHC08 V5.0.5
Note: This release not also contains some information about the C++ Compiler. If your
license configuration does not include the C++ feature, just ignore all topics related to C++.

List of new Features
- New option -Wmsg8x3 (PC only): This option truncates the file names in the message
  log file to the MS-DOS format (8.3 format). E.g. if this option is set and the source file
  is named 'mysourcefile.c', the source file referenced in the message output is
  'mysource.c'. This was the default behavior in earlier versions, because some editors
  (e.g. very old versions of WinEdit) do have problems with file names larger than 8.3
  format. The default is not to truncate the source file name in the message output.
- New option -ObjN to specify the object file name, default is "-ObjN=%n.o". This
  option allows changing the default object file name which is normally the source file
  name with extension ".o". E.g. to specify the extension ".obj" for the object files
  generated by the compiler, the option "-ObjN=%n.obj" may be specified (see manual
  for details).
- The compiler now tries to load first the variable instead the constant for byte
  comparisons. This allows a better register usage and results in denser code. Example:
  if (ch < 3)  // immediate 3 was loaded into register A, now the variable 'ch' is loaded
- New option -BfaB (see manual for details): Allocation of bitfields with a size between
  17 and 24 bits allocate now only 3 bytes instead 4 bytes. Example:
  typedef struct { unsigned long b18: 18; } B; /* sizeof(B) was 4, now it is 3 */
- interrupt keyword is now functional. Example:
  void interrupt 0 foo(void){}  /* interrupt vector 0 (address 0xFFFE) */
- The option to specify the virtual table delta size (-Tvtd, see manual for details (option -T)).
  Previously the delta value inside the virtual tables was of type 'size_t', but now it
  is possible to specify a smaller (or larger) type using the option -T. Using virtual
  member functions, virtual function tables are generated. Those tables contain a
  function pointer and an associated delta value used to access the base class. Usually
  those delta values do have a (signed) 16bit type, allowing class objects with a size of
  32kByte each. But to save ROM usage for such tables, the type of this delta value can
  be changed using the -Tvtd option. E.g. if all class objects are smaller or equal 127
  bytes, then the virtual table delta type can be changed to a 1 bytes (signed!) type using
  -Tvtd. If there should be a class object not fitting into this type, an error message
  (C1393) will be generated.
- The TreeOptimizer (option -Ont to switch it off) warns now about removed labeled
  statements. Example:
    switch(i) {
      Label: ... // Labeled statement removed
- The TreeOptimizer (option -Ont to switch it off) does also optimize modulo
  operationswith a constant on unsigned characters.
    Example:
    uch = uch % 16;  // optimized to 'uch = uch & 0xF;'
- If the environment variable OBJPATH is used, but the compiler is not able to create
  the object file in this path (e.g. because an already existing object file is locked by
  another tool, to compiler issues now an error message instead trying to create the
  object file in the path where the source has been found.
- If the Compiler is started with arguments (e.g. using a make file), the compiler does
  not grab the focus and is also visible in the task bar.
- New option -Qvtp to specify the qualifier for virtual table pointers (C++ only, see
  Manual for details)
- support for DCL
  Examples:
  asm DCL 0x12345678;
  asm DCL main:5;
- support for BSR to a label (BN1967)
  Example:
  asm {
      Label:
      Nop
      BSR Label
    }
- defines for size_t and ptrdiff_t has been moved from stddef.h to stdtypes.h, stddef.h
  includes now stdtypes.h
- The defines '__SIZE_T_IS_USHORT__' and '__PTRDIFF_T_IS_SHORT__' are now
  available.
- It is now possible to use empty blocks in HLI. This is usefull using conditional
  compilation which may result in empty blocks.
    Example:
      asm {
      #if 0
        /* something commented out */
      #endif
      }
- C++ static template member initialization
  Example:
  template <int i> struct S {
    static char A;
  };
  template <int i> char S<i>::A; // init static member
  S<3> s;
- C++ sets global constant objects to have static linkage per default
  Example:
    const int j = 0;    // j has static linkage
    extern const int i;   // i has extern linkage
- C++ does not allow initialization of array with too long string
  Example:
    char str[3]="abc";  // error, "abc" has length 4
- C++ References can be qualified
  Example:
    int j;
    void main(void) {
      int &far i = j;  // "far" qualifier for reference
    }
- cC++ language configuration
  New options for C++ support (also configurable by the option dialogbox):
  -C++f: Full C++ support
  -C++e: Embedded C++ support (EC++)
  -C++c: Compact C++ support (cC++)
  New options for enabling/disabling cC++ features (also configurable by the option
  dialogbox):
  -Cn=Ctr: Do not create compiler defined functions
  -Cn=Vf: Do not allow virtual functions
  -Cn=Mih: Do not allow multiple inheritance and virtual base classes
  -Cn=Tpl: Do not allow templates
  -Cn=Cpr: Do not allow class params and class returns
  -Cn=Ptm: Do not allow pointer to member
  Note: The option -C++ does not exist anymore !
- New options for Object File Handling:
  -Fh: HIWARE Object File Format (Default)
  -F7: strict HIWARE Object File Format
  Using the strict HIWARE V2.7 Object File Format provides full compatibility with the
  HI-CROSS V2.7 Object File Format. Using the option -F7 affects the object files in
  the following points:
- The standard type 'short' is written as 'int' into the object file
- Enumerations are not written symbolically into the object file
- The option -Fsi (treat short as int in the object file format), this is included now in the
  option -F7
- New tree optimizations (-Ont to switch it off):
  Optimization of EXOR with constants in comparisons with constants (== or !=). Such
  code sequences are common in bitfield operations.
  Example:
  unsigned char uc;

  if ((uc^3) != 2) ...
  // optimized to:
  // (uc != 1)
- New tree optimizations (-Ont to switch it off):
  Optimization of '?' operations. Such code sequences are common in bitfield
  operations.
  Example:
  unsigned char uc;

  uc = (uc&1)?-1:0;
  // optimized to:
  // uc = uc?1:0;

- The loop unrolling option now has an argument to specify the maximum loop
  unrolling iteration level. The syntax is '"-Cu" [ "=i"<number>]' where number can be
  between 0 and 1024. Without any additional arguments, loop unrolling is performed
  until a maximum of 15 iterations, e.g. 'for(i=0; i<15; i++)...'. To unroll larger loops,
  the additional argument can be used, e.g. with '-Cu=i100' loops until 100 interations
  are unrolled.
- New option to change enum type to a signed or unsigned type (e.g. -Tue1 to set
  enumeration to one unsigned type), see manual for details. Note that in the previous
  version the command line option -Tue1 was also accepted, but in fact it was the same
  behavior than -Tuce1.
- C++ default arguments
- C++ global operator overloading
  class A {
    /* ... */
  } a;
  int operator+(A a, int i);
  void f() {
    int i=a+43;
  }
- C++ conversion operator overloading
  struct A {
    operator int();
    /* ... */
  } a;
  void f() {
    int i=a;
  }
- HIWARE introduces a new generation of compilers (V5.0.x)

The new generation of compilers includes the following features:
- The compiler is now a native 32 bit Win32 application. It is about two times
  faster than older 16 bit 2.7.x version on a Win32 system.
- The compiler runs with Windows 95, Windows NT 3.x, Windows NT 4.0 and
  Windows 3.11 with Win32s (Note that not all features are available under
  Win32s due restrictions of Microsoft)
- Fully windows oriented user interface (menus, tool bars, drag & drop)
- Online help
- Flexible Type Management
- Message Management
- Smart Sliders
- Rich set of compiler options both with graphical and command line setting
- Tip of the Day
- Direct link between compiler output and editor: simply double click on ompiler
  message to open the source with the editor of your choice
- Editable command line with history
- C++ support.
- The -D option does not use any more temporary files
- fabs and fabsf are now performed inline if -Ot (Optimize for time) is given
- New Tree Optimizer (-Ont to switch it off):
  Warning about assignment in conditions for the 'for' condition
  Example:
  if (i = 0)    // warning
  Tests on IEEE32 floating values now optimized in the front end:
  Example:
  if (floatVar >= 0)    // optimized to sign test
  if (floatVar == 0.0F) // optimized to a 32bit compare
  if (floatVar != 3.0F) // optimized to a 32bit compare
  Multiplication with one is now optimized in the front end:
  Example:
  i = j * 1;  // optimized to i = j;
  Multiplication with zero is now optimized in the front end:
  Example:
  i = j * 0;  // optimized to i = 0;
  Division operations are optimized in the front end:
  Example:
  i = j / 1;  // optimized to i = j;
  i = j / j;  // optimized to i = 1;
  Subtraction with zero now optimized in the front end:
  Example:
  i = j - (j-j);  // optimized to i = j;
  Addition with same left and right expression is now optimized in the front end:
  Example:
  i = j + j;  // optimized to i = j << 1;
  Binary AND operations are now optimized in the front end:
  Example:
  i = j & 0;  // optimized to i = 0;
  i = j & j;  // optimized to i = j;
  EXOR operations are now optimized in the front end:
  Example:
  i = j ^ 0;  // optimized to i = j;
  i = j ^ j;  // optimized to i = 0;
  Constant switch expressions are now optimized:
  Example:
  switch(3)
    case 1: j = 1; break;
    case 3: i = 0; break;
  is optimized to
  i = 0;
  Constant narrowing is now performed on front end level:
  Examples:
  if (uc1 == 0x111) /* always false */
  if (uc1 <= 0x111) /* always true */
- New defines __PRODUCT_HICROSS__, __PRODUCT_HICROSS_PLUS__ and
  __PRODUCT_SMILE_LINE__ to identify the product line

List of fixed Bugs
- If a path with slashes (/) was used on a PC, the file name was truncated in the error
  feedback, e.g. for '../src/foo.c' the message line was '../src.c(3) ...'
- TreeOptimizer did a sign extension instead a zero extension for the following example
  (workaround was to specify -Ont as compiler option):
    int i; int j;
    i = (i+j)&0xff;
- improved precision for strtod()
- Correction about undefined enums.
  Example:
    enum E e;  // now legal !
- C++ labeled statements with new/delete operator calls: Generated code now correct !
  Example:
    void f(int i) {
      int a;
      switch(i) {
        case i:
          a = new int; // did produce wrong code
          break;
      }
    }
- C++ declaration of friend function with default argument in class declaration are now
producing correct code !
  Example:
    struct A {
      friend void f(int i=0); // did produce wrong code
    };
- C++ argument of function call is a function call returning inherited class is legal !
  Example:
    struct A {
      int i;
    };
    struct B : public A {
    };

    void F(A);
    B g(void);

    void main(void) {
      F(g());   // didn't compile in previous versions
    }
- C++ assignment operator overloading should also be done for initialization assign
  Example:
    struct A {
      A &operator=(int i);
    };

    void main(void) {
      A a = 3;  // call of assignment operator
    }
- C++ initialization of open array of class objects with Ctor argument
  struct A {
    A(char *);
  };

  void main(void) {
    A a[] = {"Hello"};      // now ok !!
  }
- C++ order of function calls in Constructor of inherited class
  class myclass1 {
    private:
    int private_member;
    public:
    myclass1( )  {  private_member = 9;  }    // constructor
    int  method1( int x )  {  return  x+private_member;  }
  };

  class myclass2 : public myclass1 {
    public:
    myclass2() : myclass1( )  {   // constructor
        // method1(16) should return 25
        // instead "uninitialized private_member value" + 16
      int x = method1(16);
      if ( x != 25 ) {Error;}
    }
  };
- C++ Enum inside inherited classes
  Example:
    class A {
      typedef enum {myenum=11};
    };

    class B : public A {
      int f(void);
      typedef enum {myenum=22};
    };

    int second::f() {
        return myenum;  // returns B::myenum
    }
- C++ does not allow to overload member delete operators
  Example:
    class A {
      void operator delete(void *);
      void operator delete(void *, unsigned int);   //
    error
    };
- C++ implicit casting to base class pointer for call of operator "new"
  Example:
    class A {};
    class B : A {};
    void f() {
      A *a = new B;
    }
- The preprocessor can now have the "defined" keyword not only in #if, but also in
  #define
    Example:
  #define A
  #define B defined(A)
  #if B
  /* compiled code */
  #endif
- No warning for assigning a pointer to a pointer to const void.
  Example:
  void f(const void *);
  const unsigned char cp[3];
  void main() {
    f(&cp[0]);
  }
- Register trace take now notice of CBEQ <opr>,X+,<label> instructions.
  Example:
  Bug:
    CBEQ 1,X+,L1
    INC 5,X ;wrong access to local object with
  L1: ... frame address 5,X
  Correct code:
    CBEQ 1,X+,L1
    TSX
    INC 5,X ;correct access to local object
  L1: ... with frame address 5,X
- For interrupt handlers with function calls in it the stack space for local variables is
  freed before calling the interrupt exit runtime routine (reported bug).
- the control flow for character conditions like (a + b ~ c), a,b,c are character variables
  or constants, is now correct (reported bug)
- The branch optimization is rewritten to assure the range (-128 .. 127) for short branch
  displacements (test bug)
- Deferenzations via constant pointer gave an internal error in the HC08 backend. This
  has been fixed.
  Bug Example:
  typedef struct {
    char ch;
  } S;
  #define cptr ((S *) 0x200)
  void main() {
    char ch = S->ch;
  }
- Reported assertion bug concerning initializations of pointers with constant addresses
  0x00 and field offset fixed.
  Bug Example:
  typedef union {
    int a;
    unsigned char b;
  }A;

  unsigned char *pa = &(*(A *)(0x00)).b;

List of known Bugs
- The compiler cannot handle switch expression over long variables.
    Workaround: use if-else if-else
    Example:
  unsigned long uL;
  unsigned int ui;

  switch(uL) {
    case 0: ui = 1; break;
    case 1: ui = 10; break;
    default: ui = 0; break;
  }
  produces an error message, so the above statement has to be rewritten with an if-else
  if-else:
  unsigned long uL;
  unsigned int ui;

  if (uL == 0) {
    ui = 1;
  } else if (uL == 1) {
    ui = 10;
  } else {
    ui = 0;
  }
- The messages of the back end are not yet in the new error message format (e.g. C1234:
  ERROR message). The options -W1 and -W2 only affect messages in the new
  message format with the preceding number
- The -OdocF option does not care about illegal option combinations (e.g. mixing
  memory models). [Note: The -OdocF option (OptiHunter(tm)) is only available
  with a special license].
- Be careful with -Oc and aliases:
  The common subexpression elimination (option -Oc) cannot check for all cases if a
  memory location is referenced with several pointers, e.g. a pointer pointing to itself.
- Incorrect code is generated for following example:
  char *p;
  *p++ |= 1;  /* set bit #1 */
      workaround:
  char *p;
  *p |= 1;
  p++;


RELEASE NOTES CHC08 V5.0.3

List of new Features
- The help file now contains context help for the whole user interface and for all
  available options.

- The banked memory model was added.
  In the banked memory model functions are using the far calling convention by
  default.
  The banked memory model has it's own, new libraries.

- the far calling convention was added for absolute calls
  Functions using the far calling convention can be anywhere in a 24 bit address range
  in a area controlled by a page register.
  The page register is accessed only with the runtime routines in farcal08.c, which is
  delivered with this compiler.
  The page address in the delivered libraries is 0x40. If your hardware has the page
  register at a different address, adapt the file farcal08.c. Then recompile it with the
  memory model options you are using. Then link it in addition to the ansi library. The
  linker uses your object file instead of the one in the library.
  and the default

  Note that the far calling convention is not supported jet for function pointers.
  Therefore in the banked memory model function pointers can only point to functions
  explicitly marked as near. E.g.

  void f_far(void);
  ?pragma DATA_SEG NEAR MY_SEG
  void f_near1(void);
  ?pragma DATA_SEG DEFAULT
  void near f_near2(void);

  void (*fkt_type) (void);

  fkt_type f_fail= f_far; // ERROR not possible to call far function with fkt pointer
  fkt_type f_ok1= f_near1; // OK
  fkt_type f_ok1= f_near2; // OK

  Note that f_near2 must be allocated in a non banked area. Also the segment
  MY_SEG must be allocated in the link parameter file in a non banked area.

List of fixed Bugs
- Sideeffects in opassigns on the left side are now correctly evaluated only once.
  Previous compiler versions did generate wrong code for the following code :
    char *p;
    *p++ |= 1;  /* set bit #1 */

List of known Bugs
- The interrupt keyword does not work correctly in this version, so do not use it.
- The compiler cannot handle switch expression over long variables.
    Workaround: use if-else if-else
      Example:
    unsigned long uL;
    unsigned int ui;

    switch(uL) {
      case 0: ui = 1; break;
      case 1: ui = 10; break;
      default: ui = 0; break;
    }
  produces an error message, so the above statement has to be rewritten with an if-else
  if-else:
    unsigned long uL;
    unsigned int ui;

    if (uL == 0) {
      ui = 1;
    } else if (uL == 1) {
      ui = 10;
    } else {
      ui = 0;
    }
- The help file does not contain specific help for all messages. If the context help of
  such a message is called, a default entry is shown.
- The -OdocF option does not care about illegal option combinations (e.g. mixing
  memory models). [Note: The -OdocF option (OptiHunter(tm)) is only available
  with a special license].
- Be careful with -Oc and aliases:
  The common subexpression elimination (option -Oc) cannot check for all cases if a
  memory location is referenced with several pointers, e.g. a pointer pointing to itself.


RELEASE NOTES CHC08 V5.0.1

List of new Features
- HIWARE introduces a new generation of compilers (V5.0.x)
  The new generation of compilers includes the following features:
- The compiler is now a native 32 bit Win32 application. It is about two times
  faster than older 16 bit 2.7.x version on a Win32 system.
- The compiler runs with Windows 95, Windows NT 3.x, Windows NT 4.0 and
  Windows 3.11 with Win32s (Note that not all features are available under
  Win32s due restrictions of Microsoft)
- Fully windows oriented user interface (menus, tool bars, drag & drop)
- Online help
- Flexible Type Management
- Message Management
- Smart Sliders
- Rich set of compiler options both with graphical and command line setting
- Tip of the Day
- Direct link between compiler output and editor: simply double click on ompiler
  message to open the source with the editor of your choice
- Editable command line with history

List of fixed Bugs
- none

List of known Bugs
- The interrupt keyword does not work correctly in this version, so do not use it in this version
- The compiler cannot handle switch expression over long variables.
    Workaround: use if-else if-else
      Example:
    unsigned long uL;
    unsigned int ui;

    switch(uL) {
      case 0: ui = 1; break;
      case 1: ui = 10; break;
      default: ui = 0; break;
    }
  produces an error message, so the above statement has to be rewritten with an if-else
  if-else:
    unsigned long uL;
    unsigned int ui;

    if (uL == 0) {
      ui = 1;
    } else if (uL == 1) {
      ui = 10;
    } else {
      ui = 0;
    }
- The messages of the back end are not yet in the new error message format (e.g. C1234:
  ERROR message). The options -W1 and -W2 only affect messages in the new
  message format with the preceding number
- The -OdocF option does not care about illegal option combinations (e.g. mixing
  memory models). [Note: The -OdocF option (OptiHunter(tm)) is only available
  with a special license].
- - Be careful with -Oc and aliases:
  The common subexpression elimination (option -Oc) cannot check for all cases if a
  memory location is referenced with several pointers, e.g. a pointer pointing to itself.
  - - Incorrect code is generated for following example:
    char *p;
    *p++ |= 1;  /* set bit #1 */
      workaround:
    char *p;
    *p |= 1;
    p++;
