2025-10-24: Version 0.1.97 released

    The switch() statement now supports implementing Duff's Device:
    https://en.wikipedia.org/wiki/Duff%27s_device

    Putting a statement before the first case or default clause of
    a switch() statement now issues a warning instead of an error.

    Fixed cases where a continue outside of a loop, or a break
    outside of a loop or switch(), were not flagged as errors.

    printf() now supports a runtime minimum field width for
    int, long and string values, using the asterisk, e.g.,
    printf("%*u", theWidth, theUnsignedIntegerToPrint),
    printf("%*ld", theWidth, theLongIntegerToPrint),
    printf("%*s", theWidth, theStringToPrint).
    A negative width value causes left justification.
    So does a minus sign before the asterisk.
    A minus sign and a negative width value cause left justification.
    Zero-padding is not supported when using a runtime field width.

    Added function readDECBFileWithDECB(), which is declared by
    <coco.h> and is like readDECBFile(), but uses Disk Basic's
    floppy sector I/O routine and Basic's IRQ service routine.

    Assembly labels section_size_* are not generated anymore.
    They reported the wrong value. The size of a section can be
    determined with the l_* synthetic symbol listed in the linking
    map file.

2025-09-13: Version 0.1.96 released

    Fixed a bug with prinf("%-05d", ...) where the minus sign
    was printed after the zero-padding ("000-1"), instead of
    before ("-0001").

2025-09-12: Version 0.1.95 released

    printf() now supports a minimum field width for 'long' values.

    Fixed a bug where "floatExpr < 0" was mistakenly taken as
    always false.

    Documented the fact that strtof() accepts spaces in numbers
    when using Color Basic's floating point routines.

    Fixed a bug where strtof() wrote through a null pointer if the
    'endptr' parameter passed to that function was null.

2025-09-08: Version 0.1.94 released

    atoi, atoui(), strtof() and atoff() now tolerate leading
    white space characters before the number to be converted.
    (atol(), atoul(), strtol() and strtoul() already supported that.)

    printf() and sprintf() now accept specifying a minimum field width
    for 'int' values, either left- or right-justified, but not for
    'long' values. Example: printf("%5u %-5d %04x\n", ...). (This was
    already supported for %s.)

    Added option -Wno-array-size-zero to disable the warning on
    arrays of size zero, e.g., int n[0], or enum { K = 0 }; int m[N].

    Option -Wshadow is now equivalent to -Wlocal-var-hiding, which
    issues a warning when a local variable hides another one.

    The --verbose option now prints the CMOC version number.

    Improved the code size reduction achieved by --no-relocate.

    Added an optimization for boolean conditions of the form
    {unsigned expr} < 0 and {unsigned expr} >= 0, where 0 is 16-bits.
    These conditions are respectively always false and always true.
    An if(), while() or do-while() that uses such a condition is
    now optimized accordingly.

    Added an optimization for casting a long value, shifted 16 bits
    to the right, into a short value.

    Fixed a bug that prevented supporting pointers to functions
    that use the GCC calling convention, including struct members
    of type pointer to function.

    Slightly improved an optimization that applies to constants
    passed to a __gcccall function.

2025-08-09: Version 0.1.93 released

    Fixed a bug with an optimization (of word constants) added
    by 0.1.92.

    CMOC is now compiled with -Weffc++ when using g++, to ensure
    a warning when a class member is not explicitly initialized
    by a constructor initializer.

2025-08-08: Version 0.1.92 released

    Added option -w, which inhibits all warning messages.

    Fixed a bug where a warning about an array of size zero was issued
    for a struct array member whose dimensions are in a typedef.

    The compiler now generates section_size_* labels whose value in
    the .lst file indicates the size of the assembly language sections
    that form the object file. (The .lst file can be generated by passing
    --intermediate or -i to the compiler when compiling a C file.)

    Minor optimizations added.

    Giving the command "make pdf" in the source tree now generates
    a PDF version of the manual (in the "doc" subdirectory), but
    the system must have the pandoc and pdflatex packages.

2025-05-31: Version 0.1.91 released

    Fixed a bug with casting a long to a char as part of an expression.

    Added strtol16(), strtoul16(), atol16() and atoul16(), which convert
    a hexadecimal string of digits to a long or unsigned long value.

    Added ultoa16(), which converts an unsigned long value to a string
    of upper-case hexadecimal digits, with no "0x" prefix.

    strtol() and strtoul() now support leading white space characters
    and a leading plus sign.
    strtol() and strtoul() are now macros that call functions strtol10()
    and strtoul10(), to avoid passing a 10 needlessly.
    (CMOC's versions of those functions only support base 10.)

    Added an optimization for consecutive LEAS instructions.

    Added an optimization for consecutive function arguments getting
    pushed with PSHS B,A. Retired optimization mergeConsecutivePushXs()
    because it assumed that register D is dead.

    Added an optimization for some GCC convention function calls.

    Added an optimization for the computation of an array element's address.

    An error is now reported in a case like enum { A } enum { B };
    where a semi-colon is missing before the 2nd 'enum'.

    Fixed the interpretation of decimal arguments to command-line options
    to help detect when hex is used instead.

    Fixed the emission of comments describing a function's parameters and
    local variables, so that two or more locals that have the same name
    each have a comment line in that description.

    Fixed some typos in the manual.

2025-01-03: Version 0.1.90 released

    Added a "de-optimization" option -fno-omit-frame-pointer to tell
    the compiler to keep the frame pointer in a register for every
    function that is not a pure assembly language function. This can
    help determine the call stack up to the main() function.

    Fixed an optimization bug in ASMText::removeUselessOps() that
    introduced a bug in some switch() statements when also using
    --no-relocate.

    Fixed a USim build issue concerning the <sys/select.h> header
    on Alpine Linux.

    Removed sbrk() and sbrkmax() from the OS-9 support library.

2024-10-16: Version 0.1.89 released

    Function pmode(), provided by <coco.h>, does not change the
    screen mode anymore; this is now done by screen(), as in
    Extended Color Basic's PMODE and SCREEN commands.

    When calling screen() to activate the text mode, the true-lowercase
    mode is now preserved (on CoCos where that mode exists).

    The OS-9 implementation of putchar() has been fixed to use
    character 13 (Carriage Return), instead of 10, as the
    line-ending sequence.

    The switch() statement now supports 32-bit expressions and
    case values. The instrFollowingUncondBranch low-level optimization
    has been removed as a consequence, for being incompatible.

    Fixed a bug with the switch() statement involving a signed
    char case expression and a case value above 32767, or a byte-sized
    case expression and a case value that does not fit a byte.

    Fixed a bug with the switch() statement involving a jump table
    and a default clause.

    Improved optimization of pushes that involve X and D.

    The warning about mismatching function parameter types has
    been augmented with the location of the function definition,
    when possible.

    The manual now documents __gcccall, which allows a function
    to use the GCC calling convention.

2024-07-12: Version 0.1.88 released

    Zero-length arrays are now supported. They are not part of
    Standard C, but are supported by GCC. A warning is issued.

    Fixed a bug where an int-typed constant argument to a __gcccall
    function parameter of type 'char' was passed in X instead of B.

    Fixed a performance problem with the removeUselessParameterSave
    low-level optimization.

    Added pragmas push_calling_convention and pop_calling_convention.
    The functions declared between a push and a pop use the calling
    convention given as an argument to push_calling_convention, unless
    the function declaration already has a calling convention keyword.
    Example:
    #pragma push_calling_convention __gcccall
    int foo() { ... }  /* will use the __gcccall convention */
    #pragma pop_calling_convention

    Added a few optimizations for the __gcccall convention.

    Added command-line option --cpp=<path> to allow the cmoc invocation
    to specify an alternate C preprocessor.

    Added command-line option -Waccept-word-sized-return-type-mismatch
    to make the compiler only issue a warning instead of an error when
    a return statement mismatches the function's return type, but both
    types are a word, a pointer or an array. This may help port K&R code.

    The error message that is issued when the return type or formal
    parameters of a function differs from a previous declaration of the
    same name now shows the complete prototype of the two declarations.

2024-07-07: Version 0.1.87 released

    Experimental support for the GCC6809 calling convention:
    __gcccall int foo(char a, int b);

    The low-level optimizer does not use the Y register by default anymore.
    New command-line option -Oy has been added to allow this. It has no
    effect on OS-9 and in functions that use the GCC6809 calling convention.

    Under OS-9, an interrupt function is expected to receive a single
    parameter, of type unsigned char, and it must use the GCC6809
    calling convention (whereby that parameter is received in B).
    An interrupt function that receives no parameters is still accepted
    under OS-9.

    Added command-line option -funsigned-char to specify that `char' is
    unsigned by default. (Without this option, it is signed by default
    under CMOC.)

    Added command-line option --initial-s=<hex-address>, which generates
    an immediate-mode LDS instruction as the first instruction of the
    executable. It is not compatible with --os9.

    A warning is now issued when an assignment is used as a condition
    of an if(), while() or do-while() statement. New command-line option
    -Wno-assign-in-condition can be used to disable this warning.

    Added command-line option --lwasm-pragma=<pragmas> that allows
    specifying the pragma(s) passed to lwasm's --pragma option.
    By default, this is `forwardrefmax'. More than one pragma can be
    passed by separating them with commas.

    __FUNCTION__ and __func__ are now of type `const char[]' instead
    of `char[]'.

2024-03-10: Version 0.1.86 released

    Added experimental command-line option --mc6839, which allows single-
    precision floating point operations, by adding the 8k image of
    Motorola's MC6839 ROM. Those operations are then independent of
    Color Basic's floating point routines, and Basic does not have to
    be present. When using this option, the use of the %f placeholder
    in a printf() statement requires calling enable_printf_float()
    at the beginning of main().

    Added sbrk() and sbrkmax() for OS-9. [REMOVED as of CMOC 0.1.90.]

    Added strspn(), strcspn(), strtok(), strpbrk().

    Fixed the definition of the program_end label on OS-9 so that it
    follows the code and read-only globals, instead of following the
    rwdata and bss sections, which are in the data segment.

    Added option -Wshadow, which warns if a local variable hides another one
    in the same function.

    Added ssize_t, a signed version of type size_t. It is defined by cmoc.h.

    Fixed a bug with -fomit-frame-pointer to take in account other routines
    that pop their argument off the stack before returning.

    Fixed a bug with the line number that accompanies the "array `...'
    assumed to have one element" warning.

    Fixed a bug with the --limit option where the executable file would be
    left existing when the limit was exceeded, at the risk of the user
    launching a program that is too long.

    Fixed a bug where the compiler crashed when using an undefined enum name
    in an array's size.

    Fixed a bug where a syntax error was issued for an empty enum.

    A warning is now issued when assigning a long value to an int.

    A warning is now issued when a character constant, e.g., 'x', is passed
    to a function parameter of pointer type.

    The compiler does not issue the same error or warning message more than
    once for a given source line anymore.

    Added strrchr() to CMOC's standard library.

    strlen(), strcpy(), strncpy(), strcat(), strlwr(), strupr(), strchr(),
    strstr(), memcpy(), memcmp() and memicmp() do not preserve X anymore.
    That register does not need to be preserved by a function under the
    CMOC calling convention.

    Command-line option -Wgives-byte now gives no warning about binary
    operations on bytes yielding a byte if either operand has a cast,
    e.g., x + (char) y. A warning is still given on x + y.

    Fixed -Wgives-byte so that it does not warn on a binary operator
    applied to a small enum value (which is int) or a small sizeof value
    (which is size_t).

    A warning is now issued when a label is put on a declaration, e.g.,
    case 42: int n = 0;
    New command-line option -Wno-label-on-declaration disables this warning.
    gcc 9.4.0 gives an error for this.

    Minor optimizations, including to struct assignments and to the
    initialization of an array from a string literal.

    An error is now given when no argument is passed to --stack-space=,
    --add-os9-stack-space= and --function-stack=.

    Command line option --deps-only now fails if the preprocessor exits
    with a non-zero status.

    Options -MT, -MD, -MP and -MF added to help support the gcc3 dependency
    style supported by GNU Automake.

2023-09-02: Version 0.1.85 released

    Function-local function prototypes are now supported.

    A K&R prototype for a function that specifies no return type is now
    allowed, but only at the top level, not inside a function. The return
    type is assumed to be int. Example: f(); int main() { return f(); }

    Calling an undeclared function does not generate an "undeclared
    identifier" error anymore. It now generates a warning about calling
    an undeclared function. This can be useful to port K&R-style code.
    Suchs calls are assumed to return an int.

    Fixed a crash that could happen when compiling an empty file.

    A failed assert() statement now calls exit(1) instead of freezing.

    The <assert.h> header now defines _FreezeOnFailedAssert() to determine
    what happens after a failed assert, and _SetFailedAssertHandler() to
    determine the function to be called when an assert() fails.

    The compiler now detects a typedef with an initializer (e.g.,
    typedef int a = 0;) and issues an error message for it.

    New option -Wno-unknown-first-dim keeps the compiler from issuing
    "array `...' assumed to have one element" warnings.

    The "too many elements [...] in initializer for array" error is now
    a warning and new option -Wno-too-many-elements keeps the compiler
    from issuing it.

    The compiler now warns about bit shifts that always give zero, e.g.,
    unsigned char a = ..., b = a << 8. New option -Wno-shift-always-zero
    turns off this warning.

    Fixed a memory leak that occurred during parsing of K&R parameter lists.

    Added a small optimization to the code that computes the address of
    an array element when the elements are less than 256 bytes in size
    and the element index is 16 bits. Added a small optimization to some
    16-by-8 multiplications, and to the initialization of a local character
    array.

    Added an optimization that removes repeated LDX instructions, which
    allows other, pre-existing optimizations to remove more instructions.

    Improved detection of overflows in the computation of multi-dimensional
    array sizes.

    CMOC is now built with -Wsuggest-override when the C++ compiler supports
    that option. The CMOC source code now uses the override keyword (a C++11
    feature) on the overriding virtual functions.

2023-08-17: Version 0.1.84 released

    Added option "-x c" to indicate that all files whose extension is not
    .a, .asm, .o or .a must be assumed to be C files, and option "-x none",
    which is the default, which only considers .c files to be C files.

    Verbatim assembly blocks (asm {...}) are now allowed at global scope.
    If a sequence of more than one assembly blocks precedes a certain
    C function, those blocks are all emitted, in order, just before that
    function's code.

    Fixed bugs that prevented returning an integral type from a
    float-returning function, and returning a float from a long-returning
    function.

    Fixed a bug with -fomit-frame-pointer that did not take in account
    the fact that some CMOC utility routines pop their argument off the
    stack before returning.

    Fixed a bug with the += operator that sometimes caused two bytes
    to be leaked on the stack, although without -fomit-frame-pointer,
    this did not keep the function from returning normally.

    Fixed a bug where an error was given when trying to change a struct
    member through a const pointer to a non-const struct.

    Fixed a bug where a string literal cast to a character pointer type
    would not be usable in a constant initializer.

    Fixed a bug where a numerical constant cast to another numerical type
    or to a pointer type would not be usable in a constant initializer.

    Error "return without argument in a non-void function" is now a warning.

    Replaced the implementation of sqrt16() with one which is about 35%
    faster on average on a CoCo, as measured with XRoar 1.4.2.

    Fixed bugs that affected a pointer to an array, e.g., int (*a)[20].

2023-07-14: Version 0.1.83 released

    The compiler now gives an error, instead of a warning, when the
    linking phase detects that a global variable or function name with
    external linkage is used in two different modules. No error or warning
    is given when the two variables or functions are static, i.e., have
    internal linkage. Previously, a warning was given in all these cases,
    and the user had to figure out if the symbols involved had internal
    or external linkage. A name clash is not a problem in the internal
    linkage case.

    Fixed a build problem on OpenBSD where Parameters.cpp failed to compile
    because WEXITSTATUS() and WIFEXITED() were not declared.

    Fixed an inline assembly bug where LDD #foo would try to refer to a
    C variable named foo if one exists. An instruction argument of that form
    now always refers to assembly label foo, never to a C variable.
    To force a name in an inline assembly argument to refer to a C variable
    or enum, precede it with a colon (e.g., LDD :n).

    isspace() now returns non-zero for '\f' and '\v'.

    Functions attr(), cls(), getTextMode(), hscreen(), locate(), palette(),
    paletteRGB(), resetPalette(), setBorderColor(), setHighSpeed() and
    width() (declared by <coco.h>) do not require a previous call to
    initCoCoSupport() anymore.

    resetPalette() (declared by <coco.h>) does not require the presence
    of Basic anymore.

2023-04-29: Version 0.1.82 released

    Added new header <setjmp.h>, which provides C functions setjmp()
    and longjmp().

    Defining and calling a function using a parenthesized function name
    (e.g., void (foo)(...) {...}) is now supported.

    Added optimization option -fomit-frame-pointer to tell the compiler
    to not keep the frame pointer in a register for functions that do
    not need one. This can shorten the program. This option is not on
    by default. It does not act on functions that use inline assembly.
    It should be used with caution because it has not seen much use as
    of this release.

    The asm() directive, not to be confused with asm{}, now produces
    inline assembly text that is tagged in ASMText as INLINE_ASM instead
    of INSTR. This ensures that the text generated by both directives
    is processed the same way by the optimizer. (It is recommended to
    use asm{} because it supports multi-line assembly code.)

    Added warning option -Wfor-condition-sizes, which warns if a for()
    loop's condition compares values of different sizes. For example:
    unsigned n = 256; for (unsigned char i = 0; i < n; ++i) {...}

    Local static variables whose initializer involves a string literal
    are now supported, instead of giving a compilation error.

    Fixed an issue where an error was issued in a byte-returning function
    for a return statement that used a comma expression finishing with
    a byte-compatible sub-expression. Example: return (f(), 'x');

    CMOC is now compiled without debugging information by default.
    To compile CMOC with it, pass --enable-debug to the configure script.

    Added minor optimizations.

    Moved the Parameters class to its own file.

2023-02-03: Version 0.1.81 released

    Fixed a bug where the compiler crashed on a struct member array with
    an invalid array size. An intelligible error message is now issued.

    Fixed usim compilation problems when building CMOC on Cygwin.

    Added sqrt32() to CMOC's standard library (declared by <cmoc.h>).
    It computes the integer part of the square root of the given
    32-bit number.

    Added an optimized routine for dividing an unsigned byte by 3 that
    is faster than the general byte division routine.

    Optimized the case where an unsigned char value that is cast to an
    int is multiplied by another unsigned char value on the right.

    Fixed a bug where the compiler gave a superfluous error message when
    a break or continue keyword was used outside of a breakable statement
    (in addition to the normal error message).

    Fixed bugs in memcmp(), memicmp(), strcmp(), stricmp() for OS-9.

    readDECBFile() now avoids reading a data sector for nothing in the
    case of an empty file. Note that the destination buffer must be at
    least 256 bytes, even if the file to be read is shorter than that.

2022-09-16: Version 0.1.80 released

    Options --raw and --srec are now usable with --dragon. Previously,
    they caused a fatal error.

    Fixed a bug with the code generated when += or -= were used on
    pointers to multi-byte types other than int.

    Fixed a bug where an OS-9 executable that used %f in a printf() call
    would crash.

    readDECBFile() now returns the file length in bytes, not the total
    length of the sectors read.

    Fixed printf() format string warnings. A warning is now issued for
    "%04 ", where there is no conversion specifier.

2022-08-24: Version 0.1.79 released

    Floating-point arithmetic using the float type is now supported
    when targeting the DragonDOS environment.

    Added option --add-os9-stack-space, which allows specifying a number
    of bytes to add to the stack space normally allocated by OS-9.

    Fixed a bug with the references to `fixserr' in the OS-9 runtime
    (crt.asm) and to `chrtomem' in the OS-9 version of sprintf().

    The compiler now issues a warning when passing a struct or union to
    printf() or sprintf().

    The BSS section is now emitted at the end, to avoid a hole in the
    executable. This helps shrink the executable file in some formats
    like the DECB .bin format. As a consequence, #pragma exec_once
    has been removed.

    Inline assembly statements can now refer to fields of a struct variable,
    e.g., asm { inc :player.score }.

    Fixed a potential bug involving the += operator applied to a long on
    the left side and a float on the right side.

    Indexes into C arrays in inline assembly statements are in array elements,
    not in bytes. A warning is issued on such an index when it is not zero.
    This warning can be disabled with -Wno-inline-asm-array-indexes.
    Indexes into non-arrays are in bytes.

    Pointers to pointers to functions are now supported without having
    to create a typedef for the pointer-to-function type.
    Similarly for arrays.

    Added minor optimizations.

2022-07-05: Version 0.1.78 released

    Added more optimizations. The branch shortening optimization is
    slightly more aggressive. Assembly errors about short branches
    being out of range should be reported.

    Functions rand(), sbrkmax(), readword(), readline() and typedef
    ConsoleOutHook are now declared rand(void), etc.

    Added support for compilers that need an explicit option (e.g.,
    -std=c++11) to recognize the C++11 features used by the CMOC
    source code.

    Fixed bugs with local static variable support: one that prevented
    having two functions in the same translation unit that defined a
    local static of the same name, and one that omitted the assembly
    language definition of a local static that did not have an
    initializer.

    Fixed a bug with negating a float variable containing 0.0f (the
    resulting mantissa was not entirely zeroes).

    Fixed a potential bug with the compile-time evaluation of a name
    that is an enumerator name hidden by a local variable name.

    Fixed a potential bug with the compile-time evaluation of a signed
    byte getting cast to a signed integer.

    Fixed a potential bug where structs whose initializers contain fewer
    values than there are fields would leave those bytes undefined.
    They are now initialized to null bytes.
    This also applies to array initializers.

    Fixed a bug where a global character array initialized from a literal
    that is shorter than the array would be generated without the trailing
    null bytes.

    Fixed a K&R prototype bug where a prototype without any parameters
    would forbid calls with parameters.

    Added a -Wno-missing-field-initializers command-line option to
    disable warnings about a struct being initialized with fewer values
    than there are fields.

    Fixed a failed assertion triggered by declaring a void variable.

    The --no-relocate option now makes the compiler emit a JSR instead
    of an LBSR for most function calls.

    Removed optimizations removeUselessLdb() and removeUselessLdd()
    because they are not safe anymore.

    A warning is now given when applying an increment or decrement
    operator to a function pointer.

2022-04-23: Version 0.1.77 released

    Added functions sinf, cosf, tanf, atanf, logf, expf, sqrtf, fabsf,
    floorf, truncf and roundf to <coco.h>.
    These functions only work on the CoCo and only if Extended Color Basic
    is present. Passing them an invalid argument may display a Basic error
    message and end the execution of the program.

    Emit an error instead of crashing when a floating-point value
    cannot be represented on the targeted platform (typically because
    it is too large or too small).

2022-03-05: Version 0.1.76 released

    Local static variables are now supported.

    Option --decb added as a synonym for --coco.

    Retired optimizeTfrOp.

2022-02-19: Version 0.1.75 released

    Added support for the FLEX operating system (--flex).

    Added abs() and labs() to CMOC's standard library (declared by <cmoc.h>).

    Fixed a bug that rejected "long int/signed/unsigned".

    Fixed a bug with the switch() statement where a large sparse array
    of switch values would generate a huge assembly language sequence.
    (The jump table cost calculator had a 16-bit overflow.)

    Fixed a bug where a static function was seen as not used, which
    caused a warning, even though it was used in a variable's initializer.

    Fixed a bug with K&R function definition parsing to support more than
    one declarator per declarator speficier, e.g. f(x, y) int x, y; {}.

    Passing a non-enum integral expression to a function that expects an
    enum value is now a warning instead of an error.

    Using an #pragma directive that is unknown to CMOC is now a warning
    instead of an error.

    A member of a const struct is now correctly typed as const, including in
    the case where the member is accessed through a pointer to a const struct.

    More error messages for const-incorrectness have been changed to warnings.

    pmode(), screen() and setPmodeGraphicsAddressEx() (declared by <coco.h>)
    are now in their own .c file in CMOC's standard library, to help reduce
    executable size.
    setPmodeGraphicsAddress() is now a macro defined in <coco.h>.

    readDECBFile() now returns an error code and has a different signature.

2022-01-14: Version 0.1.74 released

    K&R C function definitions are now accepted, experimentally.
    (Bug reports are welcome.)

    Replaced Unicode characters in dskcon-standalone.c to resolve
    compilation issues with gcc 11.2.0.

    Minor fixes to compile without warnings with gcc 11.2.0.

    No warning is issued anymore for a missing return statement if the last
    statement in the function body is an asm{} statement, because the return
    value will typically be stored directly in B or D by that inline assembly
    code.

    Minor optimizations added.

    Minor optimizations to the compiler's low-level optimizer's performance.

    Some of the compiler's C++ sources now use the 'auto' keyword to declare
    some variables.

2022-01-02: Version 0.1.73 released

    Added readDECBFile() to <coco.h>.
    This function reads a Disk Basic floppy file into memory.

    Added <dskcon-standalone.h> to CMOC's standard library.
    It provides a function that reads or writes a CoCo floppy sector.

    Added memset16(), which fills a memory region with a 16-bit word.

    The rgb() and cmp() functions are now independent of Color Basic.

    Minor optimizations added.

    Resolved a memory leak when compiling an unnamed bit field.

    No warning anymore on the number of elements in an initializer used to
    initialize a union variable.

    The makefiles do not define docdir anymore, since that variable is
    defined by Autoconf.

2021-11-19: Version 0.1.72 released

    Fixed a code generation bug with an array whose initializer has fewer
    values that the length of the array.

    Fixed a code generation bug with casting a long to a pointer.

    Fixed a bug where some writable arrays would be put in the read-only
    section.

    New -Wno-uncalled-static option to disable the warning on a static
    function that is not called.

    Added C functions memmove(), memichr() and vsprintf() to CMOC's library.

    Bug fix: Option --check-null now covers an assignment through a
    literal null pointer.

    Fixed a problem with -nodefaultlibs that caused struct assignments to
    cause a linking error. Note that struct assignments require the program
    to provide memcpy() when the program is built with -nodefaultlibs.

    Command-line option -Wgives-byte now gives no warning about binary
    operations on bytes yielding a byte, if both operands have a cast,
    e.g., (char) x + (char) y. A warning is still given on x + y.

    Command-line option --deps-only now takes an optional argument to specify
    the path of the .d file to create.

    When the --no-relocate option is specified and optimizations are enabled,
    program-counter-relative addressing is typically replaced with absolute
    addressing (e.g., LEAX foo,PCR is replaced with LDX #foo).

    ultoa10() and sqrt16() have been slightly optimized.

    Header cmoc.h now defines SIZE_MAX, which gives the highest value that
    can be stored by the size_t type.

    Fixed a bug with the listing of a function's formal parameters and locals
    in the generated assembly language, where variables declared in sub-scopes
    were not listed.

    Fixed portability issues concerning FreeBSD.

2021-06-05: Version 0.1.71 released

    Added support for the Thomson MO and TO computers (--thommo, --thomto).

    Added C functions vprintf(), strncmp(), memchr(), isspace(),
    isdigit(), isalpha() and isalnum() to CMOC's library.

    New -Wno-printf option to disable the warning normally issued when
    the format argument of printf() or sprintf() is not a string literal.

    Fixed a bug with initializers for a struct that contains a matrix
    of characters.

    Fixed a bug where an error message would be given on an array
    parameter of a size given by the sum of a constant and an enum
    itself defined as sum. (E.g., enum {N=1+2}; void f(char a[N+1]) {}).

    Fixed a bug where the compiler crashed on a function parameter type
    mismatch instead of issuing an error message. 

    Fixed a bug where the compiler crashed on evaluating a sizeof
    argument that incorrectly used a dot instead of an arrow to refer
    to a member of a struct through a pointer, e.g., sizeof(obj.n)
    with struct S *obj.

    Bug fix: Option --check-null now covers an assignment through a
    pointer variable.

    Minor optimization in the CMOC library's multiplication utility
    routines and the memset() function.

2021-03-07: Version 0.1.70 released

    Added the --void-target command-line option, which targets a generic
    platform whose I/O system is not known to CMOC.  This target may
    be useful to users of 6809-based single-board computers or other
    unsupported platforms. Functions like putchar() and printf() do
    nothing when compiling for that target, but the setConsoleOutHook()
    function can be used to redirect those functions to a user-defined
    character output routine. (See the CMOC manual for details.)

    Added the --raw command-line option, which forces the compiler
    to generate an executable in "raw" format, as defined by LWTOOLS'
    linker (i.e., --format=raw is passed to lwlink). (This option is
    not supported when targeting OS-9.)

    Fixed a bug where the assembler failed on a reference to an external
    variable because the extern declaration was local rather than global.

    Fixed a potential problem by preventing the Vectrex exit() function
    from executing the destructors repeatedly.

    Optimized the passing of structs by value to function calls. Affects
    structs of less than 256 bytes.

2021-01-24: Version 0.1.69 released

    Fixed a bug with code emitted from array initializers containing
    string literals for a character matrix, e.g., char a[2][6] = {...}.

    Fixed a bug where an error message would have the wrong number when
    the error happens after an inline assembly block that contains an
    #if directive that generates a preprocessor line number directive
    (of the form '# <num> <filename>').

    Passing a pointer argument to a function parameter of integral type
    now gives a warning.

2020-12-20: Version 0.1.68 released

    Fixed a bug that prevented a numerical cast to a pointer, e.g.,
    NULL, from being used as an initializer.

    Fixed a bug that prevented initializing a struct local variable
    from a const struct.

    Fixed a bug that affected += and -= when applied to a function
    pointer variable.

    An error message is now given when a struct member is of type void.

    Optimized copied shifting of an unsigned long by 8, 16 or 24 bits,
    left or right.

    Added an optimization to avoid EOR or OR with 0 and ANDing a byte
    with 255.

    Optimized conditional expressions (c ? x : y).

    Using float or double when targeting platforms that do not support
    those types is now an error instead of a warning.

    Resolved "POSIX Yacc does not support %expect" warning by removing
    the %expect directive from parser.yy and passing -Wno-conflicts-sr
    to the Yacc wrapper.

2020-06-07: Version 0.1.67 released

    Fixed an issue with the unsigned long shifting optimization
    introduced in version 0.1.66.

2020-06-06: Version 0.1.66 released

    New -Wlocal-var-hiding command line switch makes the compiler issue
    a warning when a local variable declaration hides another one of the
    same name.

    Fixed a bug where a global variable initializer of the form &array[N]
    was rejected as being non constant.

    Added a low-level optimization that removes an unneeded LDB instruction
    when a byte gets compared with two values.

    Added an optimization for in-place shifting of an unsigned long by
    8, 16 or 24 bits, left or right.

    Added an optimization for the evaluation of a loop condition based
    on a comma-expression.

    Removed non-breakable spaces from several source files.

    Monolith compilation mode is not offered anymore. This also means that
    the --emit-uncalled command-line switch has been removed.

2020-04-24: Version 0.1.65 released

    Added stricmp() and memicmp() (for ASCII case-insensitive comparisons)
    to the CMOC library. (To be declared by #including <cmoc.h>.)

    Fixed a crash that happened on |=, &= and ^=, or some casts, when used
    inside an if() statement.

    Fixed an internal error that happened on some array references whose
    left side is an addition operation.

2020-04-05: Version 0.1.64 released

    Fixed a bug with enumerated names that depended on a sizeof expression
    and with array declarations that depended on such enumerated names.

2020-03-21: Version 0.1.63 released

    Fixed a 16-bit by 8-bit multiplication code generation bug to make
    sure that a 16-bit multiplication is done in those cases.

2020-03-01: Version 0.1.62 released

    Fixed global variable initialization so that non-constant initializer
    expressions are rejected as in Standard C.

    Fixed crashes where a class definition was not associated with its
    type descriptor.

    Added the --intdir=D command-line option, which can be used to have
    the intermediate files generated in directory D.

    Added strstr() to CMOC's library.

    The 'pdf' makefile target in the 'doc' subdirectory creates a PDF
    of the manual, provided that the pandoc and pdflatex commands are
    installed and in the path.

2019-10-21: Version 0.1.61 released

    New command-line option -Wgives-byte tells CMOC to warn about
    binary operations on bytes yielding a byte. For example,
    (char) a * (char) b yields a byte under CMOC, while it yields
    an int under Standard C.     

    Fixed a bug with comparisons between an int and a long.

    Fixed support for bitwise negation on a long value.

    Fixed support for logical AND and OR on long and float values.

    Fixed a crash on a constant cast to a long. 

    An implicit cast from a void pointer is now a warning instead
    of an error.

    The --monolith mode is deprecated and is not tested anymore.

2019-08-25: Version 0.1.60 released

    Fixed bugs related to function parameters of types based on
    array typedefs.

    Fixed under-reported const-correctness errors about assigning,
    incrementing or decrementing members of structs.

    Fixed a bug where an extern declaration in a function was taken
    as a local variable declaration instead of a declaration of a
    global defined in another file.

    A struct initializer is now allowed to have a lower number of
    expressions than the number of members to initialize.

    A struct whose initializer allows it to be defined with static values
    is now defined this way instead of using initialization code.

    A function whose return type is pointer to void is now allowed
    to return a pointer to any type.

    sizeof(void) now returns 1 (as with GCC) instead of 0.
    This fixes a bug where applying + or += to a void pointer failed
    to advance the pointer.

    C functions qsort() and bsearch() have been added to the
    standard library.

    Omitting a return statement in a non-void function is now a
    warning instead of an error.

    A warning is now issued instead of an error when passing a pointer
    to a signed type to a function expecting a pointer to an unsigned
    type (or vice versa).

    A warning is now issued instead of an error when the return type
    of main() is not int.

    A few low-level optimizations have been added.

    Fixed a bug where an initializer with a string literal would be
    rejected in a case where the compiler thought that the initialized
    struct was supposed to be suitable for ROM. (A string literal's address
    gets resolved at run-time, in order to support relocatability.)

    A bug with the CMP instruction and overflows has been fixed in the
    USim 6809 simulator. 

2019-06-03: Version 0.1.59 released

    A library is now allowed to provide "constructor" and "destructor"
    code sections that contain code to be run before and after main()
    respectively.
    See the manual in the "User library constructors and destructors"
    section for details. 

    Fixed a bug where a string literal used to initialize a global
    character array was emitted with backslashes taken literally
    instead of with interpreted backslash escapes. For example,
    const char vec[] = "\r" gave a 3-character array (92, 114, 0)
    instead of a 2-character array (13, 0).

    Fixed a bug where the string "<command line>" would end up in
    a .d prerequisite file on a Mac. 

    Fixed inline assembly statements so that referring to "2,s"
    is not seen as a reference to a C variable named 's'.

    Fixed a linking bug where passing subdir/foo.o would fail because
    cmoc would pass foo.o (without "subdir/") to lwlink.

    Changed the interface of the OS-9 stack check routine (_stkcheck)
    so that it does not trash the D register.
    OS-9 code that was compiled with previous versions of this compiler
    must not be linked with code compiled with this version or a more
    recent one.

    initCoCoSupport() and its global variables (isCoCo3, textScreenWidth,
    textScreenHeight) are now part of CMOC's OS-9 library. 

    --org, --dos and --data are now disallowed when targetting OS-9.

    The emitted assembly text now includes funcsize_* labels that give
    the function's size in the assembly listing file.

    Fixed an error re: return values in the "Calling convention" section
    of the manual.

2019-03-30: Version 0.1.58 released

    Fixed a crash when adding an offset to a struct member matrix,
    e.g., struct S { char m[50][15]; } s; return s.m + 42;
    Note that s.m + 42 is equivalent to s.m[42]. Both are the address
    of a 15-character array. 

    Fixed the switch() statement so that an empty body is allowed,
    and so that a body containing only a default statement is allowed.

    Fixed a case where using an enum name before it was defined caused
    a compiler crash.

    The main() return value, and the exit() argument, are now guaranteed
    to be returned in D upon exiting the program, when compiled for the
    CoCo Basic environment or for the Dragon. This can be useful to return
    a 16-bit address from one program for use by another program. Note that
    registers U and Y must be preserved (typically with PSHS and PULS) when
    calling another program.

    Case and default statements are now rejected when they are not
    inside a switch() statement.

    Restored optimization "optimize8BitStackOps" thanks to a fix
    provided by Jamie Cho.

    Fixed a potential bug in low-level optimization "coalesceConsecutiveLeax".

    Optimized the "* (byte/word *) ptr_or_array + k = ..." case.

    Optimized array indexing when the index and the element size are
    both unsigned bytes.

    Floating point and long constants are now only emitted when they are
    used by emitted code. This resolves double emissions that could happen
    with an array of constants of those types.

    Introduced itoa10(), utoa10(), ltoa10() and ultoa10(), which all
    convert an integer to a decimal string, and made itoa(), utoa(),
    ltoa() and ultoa() into macros that point to those functions, to
    reduce the code size. (The current implementations only support
    base 10.)

    16-bit multiplications by 10 are now optimized by the use of a
    specialized utility routine.

2019-01-01: Version 0.1.57 released

    The invalid statement "(void *) p = q" is not a syntax error
    anymore, but is now diagnosed as "l-value required as left operand
    of assignment".

    Reimplemented rand() as an Xorshift random number generator to
    reduce the predictability of each of the 15 bits returned.
    The previous implementation returned numbers that alternated between
    even and odd.

    Optimized assignments to long variables and to 4-byte structs.

    Optimized some comparisons of byte-sized operands.

    Fixed comparisons involving a signed byte and an unsigned 8-bit constant.

    Invalid inline assembly array references of the form "var[var]"
    are now rejected.

    Suspended optimization "optimize8BitStackOps" because of a problem
    concerning comparisons with a byte-sized function argument. 

    Modified optimization "storeLoad" so that a load of an absolute address
    is assumed to deal with a volatile memory location, like an I/O port.

    The USim simulator now accepts a --binary option to turn off translation
    of carriage returns to line feeds when writing bytes to $FF00 (stdout).

2018-11-25: Version 0.1.56 released

    CMOC now directly supports the generation of Dragon executables,
    when the --dragon option is passed. CMOC's standard library is
    expected to work on the Dragon. The float and double types are
    not supported. The <disk.h> library is not supported. 

    Added itoa(), utoa(), ltoa() and ultoa() to the standard library
    (declared in <cmoc.h>), although only base 10 is supported at
    this time.

    Fixed a bug with the substraction of a an immediate from a
    pointer that caused the compiler to fail an assertion.

    Fixed bad code generation in the case of a subtraction of
    a pointer from an array name.  

    Fixed a bug that prevented a program from subtracting a value
    of type T[] from a value of type const T *.  

    Fixed a bug in the USim 6809 simulator (used by CMOC for self-
    testing) that incorrectly simulated indexed addressing of the
    form A,R or B,R, where 8-bit accumulator A or B is used as the index.
    USim took that 8-bit index as unsigned, when it really is signed on
    a real 6809. See the end of page 3-28 of the Leventhal 6809 book.

    Moved atoff() from the stdlib library to the float library.

    readJoystickPositions() does not turn the audio back on anymore
    after reading the positions.

    The <cmoc.h> header file now defines the NULL macro, unless
    it is already defined. 

    The delay() function does not preserve D anymore. Preserving D
    is not necessary under CMOC's calling convention.

    Stopped building a USim version of the float library.

2018-10-14: Version 0.1.55 released

    Fixed a bug that gave an error when returning a non-const
    pointer from a function that returns a const pointer (e.g.,
    const char *f(char *p) { return p; }).

    Fixed a bug where C errors would still be reported when
    --deps-only was specified.

2018-10-04: Version 0.1.54 released

    The compiler now tolerates the use of NULL (e.g., (void *) 0) in
    contexts that expect a non-void pointer, e.g., int *p = NULL;

    Additional optimizations of unsigned byte multiplications.

    Added new function setPmodeGraphicsAddressEx(), which allows
    the caller to change the screen buffer address for pcls() without
    changing the currently displayed screen.

2018-09-20: Version 0.1.53 released

    Fixed an OS-9 extern array problem by fixing the way the compiler
    determines if a variable can go to the read-only section or not.
    This determination does not depend on an array's initializer anymore. 

    Fixed a bug where an external variable declaration and a variable
    definition of the same name were accepted even when they were not
    of the same type. 

    Fixed a bug with the generation of some assignments involving an array
    variable on the right side.

    Added functions pmode(), screen(), rgb() and cmp() to the library that
    ships with CMOC. These functions, which are close to their Color Basic
    equivalents, are declared and documented in <coco.h>.

    Function pcls() now takes only one argument. It used to take the screen
    address, but does not anymore because it now uses the address passed to
    pmode(). The latter must be called before calling pcls().

    Removed misnamed function showPmode0() from <coco.h>: pmode() and
    screen() should be used instead. 

    Fixed showGraphicsAddress() so that it supports PMODEs other than
    PMODE 4. This requires passing a second argument, i.e., the new value
    to assign to the SAM chip's V register. Using the pmode() and screen()
    functions is easier however.

    Added function setPmodeGraphicsAddress() that only changes the PMODE
    graphics screen address without changing the graphics mode.

    Fixed a crash that happened when the user program tried to typedef
    a function instead of a function pointer, e.g., typedef void F();

    Using a non-integer as an array subscript is now an error (as with GCC)
    instead of a warning.

    A warning is now issued when using a 32-bit array subscript. (Only the
    low 16 bits of the value are used.)

    Fixed the output format for Vectrex so that the resulting file is the
    loadable binary, with the proper header.

2018-07-21: Version 0.1.52 released

    Binary literals (e.g., `0b101010` for 42). Note that this feature is
    not part of Standard C.

    The --deps-only option does not emit code anymore.

    Fixed a linking bug where inline assembly code would call a function
    declared only by a prototype.

    A warning is now issued when declaring a variable with both the
    `extern' keyword and an initializer (e.g., extern int n = 1;).

    An error is now issued when a declaration or typedef involves
    an empty name (e.g., int a, ;).

    Fixed a bug that prevented calling a function through a dereference
    of the function's name(), e.g., void f() {}  void g() { (*f)(); }

    Hexadecimal literals prefixed with 0X (with a capital X) are now
    supported. Invalid characters in such a literal are now properly
    reported.

    Bit fields are now accepted by the compiler, but each field is
    allocated as a full char, int or long.

    A prototype for main() does not cause a warning anymore.

    Removed leading underscores from the names of assembly language
    source files in directories src/stdlib and src/float.

    Minor optimizations to the compiler's low-level optimizer.

    writecocofile:
    - The search for a filename is now case-insensitive.
    - When failing to extract a file because its name is not found in the
      disk image, an empty native file is not created anymore.
    - An iteration through the directory now stops at the first entry
      that starts with an 0xFF byte, instead of scanning all 68 entries,
      when the goal is to find an existing entry or to list all entries.     

2018-03-31: Version 0.1.51 released

    Fixed a bug that prevented defining a const long or real global
    with an initializer.

    Fixed the determination of which globals go in the `rodata' section,
    in order to allow const arrays of function pointers.

    Added command-line option --no-relocate to tell the compiler to
    assume that the program will only be loaded at the addresses specified
    by --org and --data. Not compatible with OS-9. Default for Vectrex.

    Fixed a bug with how const function pointer types were printed out
    in some error messages.

    Option --switch=jump is now overridden by the compiler when the
    jump table size would be much larger than an if-else sequence.

    disk.h: Fixed the documentation of close(). Fixed the interface
    of getFileLength() and computeFileLength() so that they can return
    the file length in bytes.

    Resolved several compilation warnings.

2018-03-20: Version 0.1.50 released

    The `const' keyword is now supported. Warnings are issued for
    statements that are not const-correct. The <cmoc.h> header now
    defines _CMOC_CONST_ to be `const', which allows a user to
    redefine it to an empty string in order to use the compiler
    library without const-correct function prototypes. The warnings
    can be silenced by giving the command-line option "-Wno-const".
    Global arrays of const integers are automatically put in the
    `rodata' section, which should make the #pragma const_data directive
    obsolete. 

    Function setConsoleOutHook() now takes and returns a function
    pointer of type ConsoleOutHook, instead of void *.

    set_null_ptr_handler() and set_stack_overflow_handler() now
    take a properly-typed function pointer argument.

    Identifier __cplusplus is now explicitly undefined during the
    C preprocessor pass.

    A semi-colon is now tolerated after the closing brace of a
    function's body, e.g., void f() {};

    The expression "string-literal"[index] is now supported.

    Fixed the low-level optimizer so that it recognizes the EXG
    instructon properly. It also now issues a proper error message
    when an unsupported instruction is encountered.

    The install-coco-boot-loader script is now quiet, unless
    --verbose is passed as an option.

2018-02-26: Version 0.1.49 released

    Returning a char or int from a function that must return a long
    is now allowed. The returned value is automatically promoted to
    a long.

    Arrays of longs, floats or doubles whose initializer is composed
    entirely of numerical literals are now initialized statically. 

    Fixed a bug that made sizeof() return the wrong value for an array
    that was declared both with and without the extern keyword.

    An error is now issued when the sizeof operator is applied to an
    incomplete type, e.g., int v[] without an initializer. 

    A warning is now issued instead of an error when declaring an array
    without a size and without an initializer, e.g., "int v[];". Such an
    array is assumed to have size 1.

2018-02-16: Version 0.1.48 released

    Fixed a low-level optimization that was incompatible with
    some signed long divisions.

    Fixed a bug that gave a false error ("has no initializer") when
    declaring an external global variable in a const_data section.

    The compiler now automatically defines _CMOC_VERSION_, which
    represents a 32-bit number of the form XXYYZZZ when the version
    is X.Y.Z. Version 0.1.48 defines _CMOC_VERSION_ as 1048.

    The uninitialized global variables are now zeroed out in the
    (deprecated) "monolith" mode also.

    An empty file can now be compiled successfully with the -c option,
    i.e., to produce an empty object file. (Compiling an empty file as
    a full program still gives a linking error.)

    Added more experimental support for OS-9.

    Vectrex is now supported in linker mode. It is not supported
    in monolith mode anymore.

2018-02-03: Version 0.1.47 released

    The uninitialized global variables are now zeroed out at the
    start of execution, on all platforms. This is the behavior expected
    by the C standard.

    Fixed the rand() function to improve its distribution.

    rand()'s seed's global variable is now only allocated when rand()
    or srand() is called. 

    Fixed a low-level optimization phase that caused problems
    with pointer arithmetic.

    New keyword __norts__ can be applied to an assembly-only function
    to keep the compiler from emitting an RTS (or RTI) instruction
    at the end of the function's body. See the "Assembly-only functions"
    section of the manual for details.  

    Added more experimental support for OS-9.

    New -nodefaultlibs command-line option excludes the compiler
    provided libraries from the linking phase. The C-like run-time
    object file is still included however. Using this option excludes
    functions like CMOC's printf() for example.

    Improved the efficiency of the code that returns a long, a float,
    a double or a struct or union.

    The code to evaluate a while() or do-while() condition is now
    emitted after the loop body, instead of before, to save one branch
    instruction per iteration. This optimization was already applied
    to for() loops.

2018-01-16: Version 0.1.46 released

    Function pointers are now type-safe. Arrays of function pointers
    are now supported. Returning a long, float, double or struct
    through a function pointer call is now supported. 

    Comma expressions are now supported (e.g., "x = 1, y = 2;").

    Header <disk.h> now requires the user to call initdisk() before
    opening a file, in order to provide a 68-byte FAT buffer to the
    library. (Previously, the library allocated this buffer with a
    call to sbrk().) Function open() has been renamed to openfile()
    to force client code to be aware of this change.

    Added more experimental support for OS-9.

    Fixed the low-level optimizer so that it properly analyzes
    instructions that involve register Y.

    Added the NULL definition to <coco.h>.

    The `const' and `volatile' keywords are now accepted but ignored.
    A warning is issued about when they are encountered.

    Several new low-level optimization phases (contributed by Jamie Cho),
    including one that improves code with lots of constant pointers to 
    memory (e.g., video memory).

    The compiler now detects the case where a struct is passed to
    a function that expects a numerical parameter, or vice versa.

    Fixed a linking bug that prevented taking the address of a static
    function in some situations. (The linker would complain about an
    external symbol not being found.)

    Fixed a bug that prevented the use of function pointer fields
    in structs.

    Fixed a bug where the assembler pass failed when using switch()
    in monolith mode.

    Fixed a bug where a success exit code was returned by the cmoc
    command when the assembler pass failed.  

2017-11-26: Version 0.1.45 released

    Fixed a bug with a declaration initializer that used a signed
    byte conditional expression.

    Fixed a clang-related compilation error (re: SwitchStmt.h).

    Resolved a clang-related compilation warning (re: yyinput()). 

2017-11-19: Version 0.1.44 released

    The switch() statement now uses a jump table in most situations
    where this takes less memory than a series of compare and
    branch instructions. The command line now accepts options
    --switch=ifelse and --switch=jump to force the compiler to
    always use one mode or the other.

    Fixed a bug on Mac OS X where the cpp preprocessor failed to
    generate its result in its standard output because the -D
    options were passed to it after the C filename. The options
    are now all passed before the filename.  

    Added --deps-only and --deps command-line options that create
    a makefile dependency file for the C file being compiled.
    See the "Generating Prerequisites Automatically" section of
    the manual. Not available in monolith mode.  

    Comparing a pointer or array with a zero of type long is
    now supported.

    Comparing a pointer or array to an integer is now detected
    as an error unless the integer is a constant. 

    Fixed a bug that prevented the user from giving the compiler
    a .asm file to assemble as a module (the other accepted
    assembly language extension is .s).

    Fixed a bug with arrays whose size was specified by an enum
    name which was the product of two other enum names.

    Added sqrt16() to the standard library. It returns the integer
    part of the square root of its 16-bit argument. Not available
    in monolith mode. 

    Added divmod16() and divmod8(), which return a quotient and
    remainder in a single operation (on unsigned integers).

    Fixed a problem that caused two consecutive load instructions
    to be emitted when assigning a constant to a variable (although
    the low-level optimizer typically got rid of the extra load).

    An error message is now given when the switch() expression is
    a real or long type. These cases are not supported as of this
    version.

    Fixed a bug where a false error was given when using the
    dereference operator (&) on the name of an array being passed
    to a function call.  

    Fixed a bug where a string literal in inline assembly was
    misparsed, which led to an invalid error message.

    An empty array initializer is not a syntax error anymore.
    A proper error message is now issued instead. (Zero-length
    arrays are not supported by CMOC.)

    Converting a void pointer to a non-void pointer variable does not
    cause a warning to be issued anymore.

    Added a typedef for BOOL in <coco.h>. It can be avoided by
    defining _CMOC_HAVE_BOOL_ before #including that header file.

2017-11-02: Version 0.1.43 released

    Linking and modular compilation are now supported. Pass -c to
    compile a C file to an object file (whose extension is .o by
    default). Pass object files to CMOC to have it link them into
    an executable. Passing a single C file, for both compilation
    and linking, is also supported. 

    - The legacy "monolith" mode can still be used by passing the
      --monolith option, but this mode should be considered deprecated.

    - Overriding a function of CMOC's standard library is not
      supported anymore.

    - Multiple definitions are only flagged as warnings, not errors,
      because the detection is based on lwlink's map files, which
      lists both exported and non-exported symbols. This means that
      two modules defining a static global of the same name will link
      but the two names will appear in the map file. However, if two
      modules define non-static functions with the same name, the
      duplication should be seen as an error by the user.

    - The header files that come with CMOC (cmoc.h, coco.h, etc.)
      now exist in two versions. The legacy versions, which contain
      function bodies, are installed in $prefix/share/cmoc, while the
      new headers, suitable for new the linker mode, do not contain
      function bodies and are installed in $prefix/share/cmoc/include.
      The compiler uses the right versions depending on the mode used.

    - In linker mode, all functions are emitted, even those that are
      not called.

    - #pragmas org, data and limit are not permitted in linker mode.
      Use command-line options --org, --data and --limit instead.

    - Linker mode is not supported when targeting OS-9 and Vectrex.
      Using --monolith may work for those targets. Version 0.1.42
      is also an option.

    Intermediate compilation files are now removed, unless the
    --intermediate command-line option is given. 

    New --data command-line option mirrors #pragma data.

    The USim simulator now accepts an executable in the SREC format.
    The executable filename must have the ".srec" extension. 

2017-10-21: Version 0.1.42 released

    Fixed a bug with adding a signed short integer to a long integer.

    Fixed an array initialization bug that happened on ARM platforms.

    Fixed a relocatability problem with code that compares a float
    with an unsigned integer.

    Replaced short branches in the floating-point library with long
    branches, to prevent assembly errors.

2017-10-09: Version 0.1.41 released

    32-bit arithmetic using the long type (signed and unsigned) is
    now supported. Header file <coco.h> now defines dword, sdword,
    uint32_t and int32_t as typedefs for long types. Header file
    <disk.h> has been adapted to use uint32_t for file offsets
    (calls to getFileLength() and seek() must be adapted).

    More low-level optimizations contributed by Jamie Cho.

    Fixed bugs concerning the initializer of an array of floats.

    Fixed a bug that prevented the compilation of a function call that
    returns a struct by value that is not received by the caller. 

    Fixed a bug where a sign extension was missing when initializing
    an int array from a signed character initializer.

    The exit status returned by main() and the one passed to exit()
    are not stored in Color Basic's floating point accumulator #0
    anymore, upon exit. This allows a program that serves as a
    USR() function to return whatever it wants in FPA0.

    Initializing a variable from a larger type is now allowed, although
    a warning is issued.

    Moved some (CoCo-specific) floating-point routines from stdlib.inc
    to float-ecb.inc.

    Fixed a potential bug in divIntSingle where Color Basic routine
    $B4F4 was called with LBSR instead of JSR. A relocated program
    would probably have crashed in this situation. 

    stdlib.inc, float-ecb.inc: Calls from a utility routine to another
    now use LBSR, to avoid assuming that the caller and the callee are
    close to each other in the final executable.   

    Header file <coco.h> now defines macros disableInterrupts() and
    enableInterrupts().

    The printf() checks that can lead to compilation warnings are now
    performed on sprintf() calls also. 

    Resolved compilation warnings issued by GCC 7.2.0.

2017-08-12: Version 0.1.40 released

    Floating-point arithmetic using the float type is now supported
    when targeting the Color Basic environment.

    Structs and unions can now be returned by value and passed by value
    to a function.

    The boolean negation operator (!) now returns 1 for true, instead of 4.

    Fixed a bug where casting a negative 1-byte constant to char would
    yield a positive number.

    Passing a word-sized argument to a function that expects a byte-sized
    argument is now permitted (a warning is now issued instead of an error).

    The ternary operator (? :) does not give a warning anymore when the
    two subexpressions differ only by being a pointer and an array to
    the same type (e.g., char * and char[]).  

    Referring to a variable from an inline assembly statement before that
    variable has been declared is now reported as an error.

    Added KEY_PROBE_* and KEY_BIT_* enum names in <coco.h> to
    facilitate the use of isKeyPressed(), a function that was
    added to that header file with version 0.1.39 of CMOC.

    Added readJoystickPositions() and readJoystickButtons()
    functions to <coco.h>.

    Using a struct in a boolean context or with an operator that cannot
    act on a struct is now reported before the code emission phase. 

2017-07-02: Version 0.1.39 released

    Fixed a bug where a typedef for a function pointer type was
    registered as a typedef for the return type only.

    Fixed a typedef bug that caused a syntax error when declaring
    a variable of a named struct defined by the typedef, e.g.,
    typedef struct X { int n; } Y; struct X foo;.

    Fixed a bug that prevented declaring a variable of an empty struct.

    Referring to an undeclared C variable or enumerator in the argument
    of an inline assembly instruction (e.g., asm { std :foo }) is now
    reported as an error by the compiler instead of by the assembler. 

    Referring to a global variable before its declaration is now reported
    as an error.

    Inline assembly statements now support comments introduced by
    a semi-colon. These comments are transmitted verbatim to the
    assembler. 

    Fixed a crash that happened on a function definition whose
    formal parameter list was omitted (e.g., void f {}).

    Removed a spurious warning message given by the optimizer when
    it would encounter JSR [___,PCR].

    The syntax error message on a non-printable character now
    represents that character in hexadecimal, to avoid sending such
    a character to the terminal. 

    Added function isKeyPressed() to CMOC-provided <coco.h>, which
    helps determine if a key is currently down or not.

    Cleaned up unused GNU gettext internationalization definitions.

2017-06-23: Version 0.1.38 released

    Fixed a compiler crash that happened in somes cases where an
    enumerator was defined from other enumerators, or from an unknown
    enumerator name.

    Fixed a bug where void return values were not ignored as they
    should have been (e.g., if (voidFunction() == 0) {}).

    Added -o FILE command-line option to specify an output filename
    other than the default, which is to replace the .c extension of
    the source file with .bin.

2017-06-02: Version 0.1.37 released

    Fixed a bug in the optimizer that made the compiler crash when
    compiling most unit tests, on some platforms (typically Mac OS X,
    sometimes on PC with Clang).

    Fixed an erroneous -O2 optimization related to register value
    prediction (re: ASMText::removeAndOrMulAddSub()).

    A portability bug was fixed in WordConstantExpr.cpp by avoiding
    a conversion of a negative floating point value to an integer type.

    The test suite now avoids using the C preprocessor's stringification
    operator (#), because this operator is not guaranteed to be supported
    by all C preprocessors. (The problem was observed on Mac OS X.)

    For portability to Mac OS X, the makefiles do not use the od(1)
    command anymore, nor the -e option of the echo command.

2017-05-13: Version 0.1.36 released

    Fixed a portability problem with the Raspberry Pi (ARM processor).
    WordConstantExpr::getWordValue() converted directory from double
    to unsigned short, which has undefined behavior. Now, the conversion
    goes from double to signed short to unsigned short.
    Also, lexer.ll and parser.yy now explicitly use signed char, instead
    of just char, to represent a character literal.

    The level 2 optimizer (-O2) is now significantly faster, thanks to a
    reduction in dynamic memory allocations.

    Added subdww() to the standard library, to subtract a 16-bit unsigned
    word from a 32-bit unsigned word.

    Added cmpdww() to the standard library, to compare a 32-bit unsigned
    word to a 16-bit unsigned word.

    Added divdww() to divide a 32-bit unsigned integer by a 16-bit
    unsigned integer. Existing function div328() has been renamed divdwb().
    (The old name is kept for backward compatibility.) However, the first
    argument of divdwb() must now be unsigned * instead of unsigned char *. 

2017-01-14: Version 0.1.35 released

    Identifiers __FUNCTION__ and __func__ can now be used to refer to
    the current function's name (e.g., printf("%s\n", __func__)).
    In the global namespace, these identifiers give the empty string.

    Added an offsetof() macro to header file <cmoc.h>.

    Fixed a crash that happened when trying to use the array reference
    operator ([]) on a void pointer. Such an expression now gives an
    "invalid use of void expression" error message.

    Fixed bugs related to the interactions between array initializers,
    array typedefs and string literals.

    The compiler now detects the use of an undefined struct or union
    to declare a member of a struct or union.

    Some optimizations that were suspended with version 0.1.34 have
    been restored after fixes to the optimizer. 

    The U suffix on a numerical constant is now applied to the type
    of the constant instead of being ignored.

    New command-line option --stack-space=N tells the compiler to assume
    the stack may use as many as N bytes. This affects --check-stack and
    the sbrk() function. This option is ignored when targeting the Vectrex.
    One can also use #pragma stack_space N. The command-line option has
    precedence over this pragma.

    The compiler now stops compiling after the parsing phase if an error
    message is issued, to avoid spurious error messages. 

    The routine that implements --check-stack now preserves the registers
    it uses, to avoid interfering with normal program execution.

    Declarator::getNumDimensions() now avoids computing the number of
    elements in a array just to get the number of dimensions, e.g.,
    for int m[3][5], we want 2 and we do not care that the array has
    15 elements. 

2016-12-26: Version 0.1.34 released

    Fixed a bug that over-optimized operations involving a byte-sized
    constant cast to a word.

    Fixed a bug that over-optimized loads of the X register. 

    Fixed an inline assembly problem in vectrex/bios.h. This only
    affects compilations that target the Vectrex console (--vectrex).

    Casting a variable name to void does not emit an instruction anymore.

2016-10-23: Version 0.1.33 released

    Fixed bugs with array typedefs.

    Fixed a bug where a top-level function-local variable was allowed
    to be defined with the same name as a function parameter.
    For example: void f(int n) { int n; }
    The compiler now puts that top level and the function parameters
    in the same scope.

    Fixed a bug with an optimization of boolean expressions
    evaluated for their numerical value.

    Fixed a potential bug with va_arg() (stdarg.h) by avoiding the
    use of the Y register, to comply with the CMOC register convention.

    The PROGRAM name in main.cpp can now be defined as a preprocessor
    identifier. By default, PROGRAM is a C++ global variable ("cmoc").

    New command-line option --allow-undef-func makes the compiler
    tolerate calls to undefined functions. The assembly pass will fail.
    Should be used with the -c option.

    New command-line option -Wsign-compare warns when comparison operators
    <, <=, > or >= are used with operands of different signedness.

    Fixed some portability problems to help compile under Visual C++.

    The writecocofile command now declares an error if extra arguments
    are given on the command line.

2016-09-17: Version 0.1.32 released

    Fixed bugs with the /=, %=, <<= and >>= operators.

    The compiler now checks that operators that require an l-value
    are actually applied on one. For example, &(n >> 1) is illegal
    and is now reported as such. 

2016-09-12: Version 0.1.31 released

    Inline assembly: When an asm{} block refers to a C variable
    whose name is that of a register, such a reference must now be
    preceded by a colon character, which acts as an escape character.
    For example: char b; asm { lda :b }
    When no such colon appears, the name is now always taken to be
    a reference to the register. Existing inline assembly statements
    may need to be fixed accordingly to resolve assembly errors.     

    Added atoi() and atoui() to the standard library.

    Fixed a bug with the return statement that omitted the sign
    extension when returning a signed character from a function
    returning signed int.

    Fixed a bug where wrong code was emitted for the multiplication
    of two members of a struct, where one of the members was the
    first of the struct.

    Fixed a bug where sizeof() on a string literal returned 2
    instead of the length of the string plus one. A string literal
    is now typed as an array of characters instead of a pointer to
    a character.

    Fixed a bug where printf() and putstr() failed to translate some
    '\n' characters into a carriage return under Color Basic. In the
    case of printf(), it was when the '\n' appeared in the argument
    of a %s placeholder.

    CMOC now rejects a variadic function that has no named argument,
    e.g., void f(...), as does GNU GCC. 

    Restored some level 2 optimizations that had been suspended
    since version 0.1.29. 

2016-08-21: Version 0.1.30 released

    Fixed a bug with the optimization of a division of a signed
    value by 10.

    Added support for extern declarations as used by WinCMOC,
    a project by Derek John Evans.

2016-08-07: Version 0.1.29 released

    Enumerations (enum) are now supported. See the manual
    for details.

    Relational operators on byte operands do not promote to int
    anymore, for efficiency reasons. This is consistent with CMOC's
    treatment of other binary operators.

    Fixed a bug in the intelhex2srec script. 

    Fixed the cmoc.h function sbrkmax() so that it returns zero
    bytes available if the program has been loaded after the
    stack space.

    The compiler now warns when a string uses a numerical escape
    sequence that is out of the 0 to 255 range (e.g., \xFFF or \0777).

2016-07-01: Version 0.1.28 released

    Typed function pointer declarations are now supported.
    For example, a variable of type int (*)(char, int[])
    can now be declared to receive the address of a function
    accepting a char and an array of ints and returning and int.
    Note that despite the typed syntax, the actual type of the
    function pointer variable is still void *. Also, when invoking
    a function through a pointer, the return type is still assumed
    to be int. If the actual function returns a char, the call
    must use a cast, e.g., char c = (char) (*pf)(). 

    A function that takes no arguments can now be declared with
    a argument list containing only the `void' keyword, e.g.,
    int f(void).

    Referring to an undefined struct is now allowed except when
    declaring a variable of that type. For example, a variable
    declaration like "struct S *p;" is allowed but not "struct S s;".
    Also, a function prototype like "struct S *f();" is allowed,
    but not "struct S f();".

    Anonymous structs are now supported. For example,
    struct { int n; } g; int main() { g.n = 42; return g.n; }

    Assigning a struct value to another is now supported (e.g.,
    struct S a, b; a = b;). Initializing a struct from another
    is also supported (e.g., struct S a; struct S b = a;).

    A typedef can now be used for an array type, e.g.,
    typedef int A[2];

    The following error messages have been downgraded to warnings:
    - assigning to byte from larger type
    - assigning to byte from larger constant
    - assignment to type 'A *' from incompatible pointer type 'B *'
    - true and false expressions of conditional are not of the same type

    The `extern' keyword is now accepted but the declarations it
    is used for are ignored, as separate compilation is not supported.

    The `static' keyword is now accepted on global declarations but
    does not affect the declarations it is used for. Those declarations
    are processed as if the keyword were not present.

    The `register' keyword is now accepted but ignored.

    The goto statement is now supported. A function's body must not
    define the same identifier-labeled statement more than once. 

    The C preprocessor now receives the -nostdinc and -undef options
    to make sure that no header file or predefined identifier (e.g.,
    __GNUC__) of the system C compiler is included in the compilation.

    The compiler now issues an error message if a pointer to a
    struct is returned from a function that must return a pointer
    to a different struct.  

    The compiler now issues an error message if an unsupported type
    keyword, like long, float or double, is used in a program.

    The writecocofile now avoids warning about lost granules if those
    granules are in track 34. This track may be occupied by a program
    to be invoked by the DOS command.

2016-06-15: Version 0.1.27 released

    Fixed a crash that happened when using a struct value in a
    context that requires an r-value, e.g., a struct as an if()
    condition.

    Fixed a bug where a conditional instruction, in an asm{} block,
    that targeted a C function was not emitted correctly, which caused
    the assembler to declare an error.

    Fixed an optimizer bug.

    The configure script now checks that POSIX.1 function strcasecmp()
    is available.

2016-05-19: Version 0.1.26 released

    Fixed another optimizer bug that affected ternary expressions.

    Fixed the writecocofile tool so that the directory entries it
    creates are compatible with EDTASM.  

    Fixed a bug in the -d option of the writecocofile command that
    made it list lost granules as being free. The lost granules
    (which are allocated in the FAT but not used by any directory
    entry) are now listed.

    setConsoleOutHook() is now defined in pure assembly in stdlib.inc
    instead of being defined as a C function in cmoc.h.

    The emitCode() virtual functions in the compiler itself are now
    const, which helps prove that emitting code does not change the
    syntax tree objects.

    Added a maintainer's guide: doc/cmoc-implementation.markdown

2016-05-01: Version 0.1.25 released

    Fixed an optimizer bug that affected ternary expressions
    (a ? b : c).

    Clarified the public domain status of header files
    cmoc.h, stdlib.inc, stdlib-data.inc and vectrex.h.

    Resolved compilation issues for gcc 6.1.0.

2016-04-21: Version 0.1.24 released

    Fixed a bug where a program using the right shift operator
    with a non-constant number of bits to shift would not compile
    unless the program also used the left shift operator with a
    non-constant number of bits to shift. (The compilation would
    fail with an error message involving shiftLeft_end.)

    Fixed a bug affecting shifting byte expressions by a
    non-constant number of bits.

    Fixed a bug in inline assembly statements when a BRA
    or LBRA instruction would be used to jump to a C function
    (the program would not compile).

2016-04-17: Version 0.1.23 released

    Fixed a bug with the signed right shift operator (>>): when
    the left side is negative and the operator shifts more bits
    than the left side holds, the result is now -1 ($FFFF), 
    instead of zero.

    The compiler optimizes more cases of shift operations whose
    the number of bits to shift is a constant. The general case,
    where the number of bits to shift by is not known at compile
    time, is now handled by a standard library routine in order
    to reduce the inline code to a subroutine call.

    A function pointer is now considered to be of type void *
    instead of char *.

    Fixed a bug where dereferencing a void pointer would lead to
    a compiler crash instead of a proper error message. 

    Fixed a bug where a switch() inside another switch(), or inside
    a for/while/do-while, would cause the break and continue statements
    after the end of the inner switch to branch to the end of the
    inner switch, when it should have branched to the end of the
    outer switch/for/while/do-while.

    The standard function sbrk() now returns void * instead of char *.

    set_null_ptr_handler() and set_stack_overflow_handler() now expect
    a void * argument instead of char *.

    Added the section "Function pointers" to the manual. 

    The documentation files are now installed in $(prefix)/share/doc/cmoc
    instead of $(prefix)/share/doc/cmoc-$(VERSION). (The HTML manual
    is still not generated or installed, by default.)

2016-04-07: Version 0.1.22 released

    Fixed an optimizer bug that affected increments on a struct field
    in some situations.

2016-04-03: Version 0.1.21 released

    More low-level optimizations contributed by Jamie Cho.

    The coco.h header file now contains functions setConsoleOutHook()
    and resetConsoleOutHook() which allow the caller to redirect
    the characters produced by printf() and putchar() to any routine.

    New "#pragma limit X" directive. It is equivalent to the
    command-line option --limit=X, which forces a failure if
    the end of the program exceeds address X.

    CMOC now tolerates passing a non-negative constant integer
    as a function parameter of type pointer. For example,
    calling f(1024) for f(char *). 

    CMOC now supports references to C functions in inline assembly.
    This allows inline assembly to call a C function or to take
    its address.

    The <cmoc.h> header file now defines setConsoleOutHook(), which is
    useful to redirect the output of printf() to a user-defined routine.
    See the manual under the "Redirecting the output of printf()"
    section for details.

    Fixed a bug with the OS-9 implementation of exit(), which
    ignored that function's argument.

    Fixed a bug where compiling a program for OS-9 right after
    compiling it for Disk Basic would fail when assembling,
    because the .hex from the Disk Basic compilation was erroneously
    read by the assembler script (a09). The latter now starts by
    erasing the .hex file if one is present.

    Fixed a bug in printf() where a zero-padding hexadecimal value
    could be padding with the wrong character if printf()'s output
    callback was redirected to a routine that did not preserve
    register A. 

    Added support for octal constants.

    Removed the last traces of support for the as6809 assembler.
    (The LWTOOLS lwasm assembler is required.)

    Added basic tests for the --os9 option in src/Makefile.am.

    Header files assert.h, stdarg.h, coco.h and disk.h are now
    in the public domain.

    Header files hirestxt.h, 8-bit-wide-font.h and font4x7.h are
    not distributed with CMOC anymore, but will be distributed
    separately.

    The configure script now has the --without-writecocofile option,
    which allows the user to avoid compiling the writecocofile
    disk image tool.

    The configure script now checks for the env(1) command, which
    is used in src/Makefile.am.

2016-02-20: Version 0.1.20 released

    Several peephole optimizations have been added by Jamie Cho.
    The --no-peephole option is now deprecated in favor of -O0.
    -O1 can be used to disable Jamie's optimizations. The default
    is -O2, which includes all optimizations. 

    Fixed a bug where the compiler crashed when sizeof() was used
    on an unknown variable name and this sizeof() was used twice in
    a binary expression.  

    Fixed a bug where assembly code was still emitted for some
    functions that were not called from main(), neither directly
    or indirectly.

    CMOC now automatically displays the program start and end addresses,
    as well as the start and end of the writable data section, when the
    --verbose option is passed. The generated assembly file now contains
    symbols writable_globals_start and writable_globals_end.

    New command-line option --limit=X forces a failure if the end
    of the program, as indicated by the "program_end" listing symbol,
    exceeds address X (specified in hexadecimal).

    The error message indicating that a variable is already declared
    in the same scope now shows the line number of the previously
    seen declaration.

    writecocofile command: New option --newlines added to facilitate
    transfering a native Basic text file to a CoCo disk image, by
    converting the line endings to ASCII 13 and preceding the first
    line with an empty line. New option --stdout added to act like
    --read but print the file contents to standard output instead of
    writing it to a native file.

2016-01-11: Version 0.1.19 released

    Fixed a bug where a function-local function prototype crashed
    the compiler. Such prototypes now give an error message.
    Function prototypes must be declared at global scope.

    Fixed a bug where the wrong line number was given in the
    error message when a character variable was initialized with
    a function address.

    Fixed a bug where the compiler would crash when taking the
    sizeof() an unknown struct name.

    The compiler now accepts option --asm-cmd, which writes
    the assembly command in a file whose name is the same as the
    source filename but with a .cmd extension.

    The inline assembly directive (asm { ... }) now accepts
    balanced braces inside the main braces.

    The internal assembler script (a09) now accepts options
    --define and --no-blocks.

2015-12-19: Version 0.1.18 released

    To regenerate the configure script, GNU Automake 1.12 or later
    is now required, so that src/parser.hh gets generated, instead
    of src/parser.h.

    Fixed a bug with the mapping of writable global variables on
    the Vectrex: they are now mapped at $C880 as imposed by the
    console RAM mapping. Also, using the --org command-line option
    and using the #pragma org and data directives are now forbidden
    when targeting the Vectrex.    

    Fixed a bug where the compiler would crash on some comparisons of
    a function address with a constant.

    The compiler does not create an assembly file anymore when there
    are compilation errors.

    Changed the include guard in cmoc.h from _H_DIZZYTOAD to _H_CMOC.

2015-11-08: Version 0.1.17 released

    Added the --vectrex option to target the Vectrex video game console.
    Vectrex support, contributed by Johan Van den Brande, is experimental
    and partial at this point.

    Fixed a bug where declaring a character array in a const_data
    section (see the manual) with a string literal as the initializer
    was rejected despite the literal being a valid array to
    initialize with. 

    Fixed a bug where comparing an unsigned character to a signed
    character would give the wrong result because the comparison was
    not allowed to promote its operands to int as it is supposed to do.

    Fixed a bug that prevented the use of non trivial constant
    initializers in a const_data section (e.g., int n = -42 instead
    of int n = 42). This fix applies to array initializers also.

2015-10-12: Version 0.1.16 released

    Fixed a bug where multiplying a negative byte constant with a
    signed byte variable would generate an invalid load instruction
    (e.g., LDA #$FFFC for -4). This bug was discovered by upgrading
    the LWASM assembler from version 4.11 to 4.12.

    Added an optimization that removes a CMPB #0 between an
    LDB and a BEQ/BNE. (The load instruction sets the Z flag
    so no comparison with zero is needed.)

    Added an optimization for byte comparisons.

    Added an optimization for comparisons of register D with 0. 

2015-09-13: Version 0.1.15 released

    Embryonic support for OS-9. (Pass --os9 to cmoc. Requires lwasm.)

    Some comments in stdlib.inc have been surrounded with /* */
    to protect apostrophes from warnings by some C preprocessors
    ("missing terminating ' character"). 

    Mac OS X compilation options now automatically added by the
    configure script. It should not be necessary anymore to define
    any environment variables before compiling the CMOC sources.

    LWASM is now the default assembler instead of FrankASM. 

    Documented the fact that the writecocofile utility assumes
    a 35-track Disk Basic diskette image file.

2015-09-05: Version 0.1.14 released

    Fixed a binary operator optimization where 0xffb0 + byteVar
    would be generated as an 8-bit add, just because 0xffb0 is -80,
    which can be represented in a single byte. The constant 0xffb0
    is actually seen as unsigned by CMOC because it exceeds 0x7FFF,
    whereas -80 is explicitly signed, because it the signed constant
    +80 to which the negation operator is applied.  Therefore, 0xffb0
    + byteVar is now seen as an unsigned word plus a byte variable.

    Fixed a bug that prevented taking the sizeof() a row of a
    2-dimensional array, e.g., sizeof(a[0]). This fix enables the
    use of the common idiom sizeof(a) / sizeof(a[0]) to get the
    number of elements in array 'a' regardless how many dimensions
    it has.

    Fixed a false compilation error that would prevent initializing
    a void pointer variable with a void pointer expression.  

    Removed unused parts of the USim 6809 simulator to facilitate
    compilation under other operating systems. (6850 ACIA and X11
    support were removed.)

    memcpy() and memset() now return a void pointer, as in C.

    Added comments to standard header file <cmoc.h>.

    The resetPalette() function in <coco.h> now only fixes the CMP/RGB
    command bug if a 15 is seen in the code, to help confirm that the
    version of Basic is the one expected.

    New function paletteRGB() in <coco.h>: it presents an easier
    interface to specify red-green-blue color intensities. 

2015-08-24: Version 0.1.13 released

    Added a --srec option to have CMOC generate an executable
    in the Motorola SREC format:
    https://en.wikipedia.org/wiki/SREC_%28file_format%29

    Fixed a usim compilation problem under Cygwin.

    The <legacy.h> header file is now obsolete. Its contents are
    provided by <coco.h>.

    The <coco.h> header now defines uint8_t, int8_t, uint16_t
    and int16_t.

2015-08-09: Version 0.1.12 released

    Added support for unions.

    Fixed a crash on a string literal used as an array initializer.

    Fixed an assembly-level optimizer bug that would make an if()
    execute the else clause unconditionally in the presence of
    inline assembly.

    Added an optimization that removes any instruction that follows
    an unconditional branch without a label or other non-instruction
    element in between.

    Improved the shortening of long branches: more branches get
    shortened, but a branch does not get shortened if inline assembly
    appears between the branch and its destination.

    Now detecting case where a declaration refers to a struct whose
    name has been declared but whose members have not been defined.
    (Example: struct S; int main() { struct S x; [...] })

2015-08-08: Version 0.1.11 released

    Removed a divergence from C: the signedness of an additive of
    multiplicative operation is now the signedness of the left operand.

    Added an assembly-level peephole optimizer. To disable this phase,
    pass --no-peephole to cmoc.

    Improved the optimization of boolean expressions when they are
    used in if, while, do-while or for statements.

    Improved the optimization of some multiplications, divisions
    and modulos. Added an 8-bit assembly-language division routine
    to the standard library. Added a specialized unsigned byte division
    by 7 routine that takes about 30% of the time of the general 8-bit
    division routine. Added an unsigned word division by 10 that takes
    about 20% of the general 16-bit division routine. 

    Added a manual page (man cmoc).

2015-07-25: Version 0.1.10 released

    Fixed a compiler crash on initializing a character array with
    a string literal.

    Fixed a bug where occurrences of "0x" in a string literal would
    be replaced with "$" in the final executable.

    New --emit-uncalled option forces the compiler to emit assembly
    code even for functions that are not called by C code. This is
    useful when a function is only called by inline assembly code.

    A struct can now declare more than one member per semi-colon:
    struct S { int a, b; char *c, *d; }.

    Assembly-only functions are now allowed to refer to global
    variables. (Such references require no stack frame.)

    Uninitialized globals are now emitted contiguously so that
    all RMB-defined globals appear at the end of the default
    executable format, which helps shorten the .BIN file.

    Optimized expressions of the form sizeof(a) / sizeof(a[0])
    by evaluating them at compile time (avoids a 16-bit division
    at run time).

    Optimized some assignments to a byte location.

    Optimized while() and do-while() statements whose condition
    is always true (no code emitted for the condition).

    Optimized passing an array (address) as an argument to
    a function (2 instructions instead of 3).

    Optimization for "variable += constant" and "variable += variable".

    Fixed some memory leaks.

2015-07-12: Version 0.1.9 released

    Restructured the standard library so that only the needed
    portions are included in the final assembly program.
    For example, the printf() code is only assembled if that
    function is called by the C program. A program that calls
    no standard library function can save up to about 1900 bytes.
    An empty program is now around 50 bytes.

    Functions that are defined but not called are not emitted
    in the final assembly program. A function is considered
    called if it is called directly or if its address is taken.

    Fixed optimization of multiplication and division of
    constant operands so that the operation is signed only
    if both operands are signed.

    The stack frame is now setup with LEA instructions instead
    of TFR, which saves 4 cycles per function call. 

    Added a table of contents to the HTML manual.

2015-07-05: Version 0.1.8 released

    Integer constants are now of type int or unsigned int,
    but operators will interpret them as char or unsigned char
    when it optimizes the code without changing the meaning
    of the operation. Violations of this rule should be reported
    to the maintainer.

    A comparison of two expressions will only use a signed
    branch instruction (e.g., LBGT) if the two operands are
    signed expressions.

    Removed signedness warnings because they were sometimes
    superfluous or inappropriate.

    Fixed a signedness problem that caused an unjustified
    compilation warning. The sum or subtraction of an 'int' and
    an 'unsigned char' now has the signedness of the int.   

    Fixed a preprocessor incompatibility problem by having CMOC
    always pass -xc++ to the C preprocessor. This allows the
    user to use C++-style comments (// instead of only /* */).

    New function modifier keyword 'asm' tells the compiler that
    the function must not have a stack frame and will only contain
    inline assembly language (i.e., asm { ... } statements).
    This is useful when writing a function entirely in assembler
    for maximum performance.
    See the manual under "Assembly-only functions".

    Fixed a bug in hset() in support file coco.h, where the function
    would access the wrong address to get the graphics mode.

    Optimized bitwise operations between a variable (possibly cast
    as a byte) on the left side and a constant on the right side.
    Optimized more binary operations involving a constant on the
    right side.
    Optimized while and do-while conditions when they are ANDs
    or ORs of relational operators.

2015-06-27: Version 0.1.7 released

    Renamed the --ihex option to --usim to better reflect
    that it compiles for USim and not for Color Basic. 

    Fixed a bug where initializing a pointer from an
    incompatible array type would potentially crash the
    compiler.

    Fixed a bug where inline assembler that would use indirect
    addressing of a C variable (e.g., "jsr [someVariable]")
    would not assemble.

    Improved optimization of += and -= operators when the
    right side is a constant.

    Improved optimization of multiplication when the two
    sides are bytes, or when the two sides are variables
    or constants. 

    Added warnings about assigning to a pointer from an
    incompatible pointer type, from a non-constant integer
    expression, or from a negative constant.

    Added a command-line tool (install-coco-boot-loader) that
    writes the contents of a CoCo DECB .bin file to track 34
    of a DECB disk image. This makes the code in the .bin file
    (max 4608 bytes) executable by Disk Basic's DOS command.

    The generated assembler now contains a "program_start"
    label that indicates where the complete program begins
    in memory. (There was already a "program_end" label.) 

    The manual (cmoc-manual.html) now documents:
    - (Obsolete:) the fact that integer constants that fit
      in a byte are of type char or unsigned char depending
      on their sign;
    - the program_start and program_end labels, that indicate
      where the program is loaded in memory.
    - the --dos option, which can be used with the
      install-coco-boot-loader tool to make a program
      executable by Disk Basic's DOS command.

2015-06-21: Version 0.1.6 released

    Fixed a bug where all compilations would fail with the
    message "syntax error: #". This was related to a version
    of GCC's C preprocessor that is more recent than the one
    (4.6.3) with which CMOC was developed. CMOC has been
    adapted to be compatible with the bevahior of cpp 4.8.3.

    Added missing file src/support/legacy.h, which is included
    by src/support/coco.h.

    Added a sprintf() function. This function requires caution
    because it does not check if the buffer it is given is
    long enough for the text that gets written to it.

    Improved optimization with better detection of constant
    expressions, which helps remove if() conditions (when it is
    always true) or the if() and its body (when the condition is
    always false). Constant expressions used in some binary
    operators are also better detected.

    Improved optimization of the shift operators when the
    right side operand is constant.

2015-06-18: Version 0.1.5 released

    Fixed bad code generation for an expression that adds a
    constant to an array that was received as a function argument. 

    Added the --check-stack option to have CMOC insert run-time
    checks for stack overflows. A handler can be specified to
    handle a stack overflow and print the code address where
    it was detected, as well as the out-of-range stack pointer.
    See the manual for details.

    The standard library now does not include code related to
    null pointer checking when --check-null is not given.
    The same situation applies to stack overflow checking.

    Added small optimization for '*ptr++' case. 

    Fixed a bug in the 'writecocofile' utility where a file whose
    length was that of one granule (2304 bytes) would be written
    as an empty file.

2015-06-13: Version 0.1.4 released

    Added the --check-null option to have CMOC insert run-time
    checks for null pointers. A handler can be specified to
    handle an access to a null pointer and print the code address
    where it was detected. See the manual for details.

    Added the -D option to allow specifying #defines from the
    command line.

    Reduced the number of instructions required for an array
    initializer to initialize a pointer element with the address
    of an array variable.

    Fixed an internal compiler error that happened when referring
    to a member of an undefined struct. 

    Fixed a problem where executing an sbrk-using program for the
    second time without reloading it first would potentially
    execute invalid memory. Up to 0.1.3, CMOC assumed that the
    compiled program is intended to be executed only once, i.e.,
    that reloading the program is required to execute it again.

    Added #pragma exec_once to get the pre-0.1.4 behavior.

    The manual (cmoc-manual.html) now documents:
    - #pragma exec_once;
    - the calling convention;
    - the files generated by the compiler aside from the .bin file;
    - how to generate a ROM image for a cartridge;
    - the new --check-null option.

2015-06-09: Version 0.1.3 released

    Fixed a bug where some origin addresses were not accepted
    by the assembler script. (The error message would say
    "does not finish with valid type-1 record".)

    Added #pragma const_data [start|end] to separate writable
    global variables from the read-only ones and the code.
    See the manual for details. 

    The manual (cmoc-manual.html) now documents:
    - global array initializers;
    - separating writable global variables from the rest;
    - dynamic memory allocation with sbrk().

2015-06-07: Version 0.1.2 released

    Fixed a bug with assembler selection so that as6809 becomes
    usable again.

    Reworked the code generation to separate the data from the code.

2015-06-06: Version 0.1.1 released

    Fixed a bug where bad code was generated when the right-hand
    side of a +=, -= or *= operator was of pointer type.

    Fixed a compilation error involving GCC 4.9.2 vs. TreeSequence.cpp
    and ClassDef.cpp and their use of the deleter() templated function.
    This function has been removed (from util.h).

    Fixed a bug where character literals were considered unsigned
    even though CMOC's char type is signed.

    Fixed the lack of error message when passing a non-zero integer
    as an argument to a function that expects a pointer.

    Fixed the lack of error message when passing a pointer of the
    wrong type to a function that expects a non-void pointer.

    LWASM support: The compiler now takes the --lwasm option,
    which makes it use LWASM instead of FrankASM (as6809).
    Requires LWASM 4.11 or later, because of the use of option
    --pragma=forwardrefmax. Another way to request LWASM is to
    define the CMOC_LWASM environment variable (to any value).
    When compiling CMOC, the `configure' script now checks that
    lwasm accepts the --pragma=forwardrefmax option, if lwasm is
    found in the execution path.

    FrankASM support: If as6809 is not found when compiling CMOC
    but lwasm is found, the latter will be used by default by CMOC.

    The manual (cmoc-manual.html) now documents:
    - inline assembly;
    - how to redirect the output of printf();
    - the default origin address, which is 0x2800;
    - the "interrupt" keyword, to end a function with RTI.

2015-05-31: Version 0.1.0 released

    First public release.
