Next: 1.5 System Requirements
Up: 1. Introduction
Previous: 1.3 Typographic conventions
Contents
Index
1.4 Compatibility with previous
versions
Newer versions have usually numerous bug fixes compared with the previous
version. But we also sometimes introduce some incompatibilities with
older versions. Not just for the fun of it, but to make the compiler
more stable, efficient and ANSI compliant
(see section 8.2 for ANSI-Compliance).
- short is now equivalent to int (16 bits), it used to be equivalent
to char (8 bits) which is not ANSI compliant. To maintain compatibility,
old programs may be compiled using the --short-is-8bits commandline
option (see lyx:-short-is-8bits).
- the default directory for gcc-builds where include, library and documentation
files are stored is now in /usr/local/share.
- char type parameters to vararg functions are
casted to int unless explicitly casted and --std-c89
and --std-c99 command line option
are not defined , e.g.:
char a=3;
printf ("%d %c\n",
a, (char)a);
will push a as an int and as a char resp if --std-c89
and --std-c99 command line options
are not defined,
will push a as two ints if --std-c89
or --std-c99 command line option is
defined.
- option --regextend has been removed.
- option --noregparms has been removed.
- option --stack-after-data has been removed.
- bit and sbit types now consistently
behave like the C99 _Bool type with respect to type conversion.
The most common incompatibility resulting from this change is related
to bit toggling idioms, e.g.:
bit b;
b = ~b; /* equivalent
to b=1 instead of toggling b */
b = !b; /* toggles b */
In previous versions, both forms would have toggled the bit.
- in older versions, the preprocessor was always called with --std-c99
regardless of the --std-xxx setting. This is no longer
true, and can cause compilation failures on code built with --std-c89
but using c99 preprocessor features, such as one-line (//) comments
- in versions older then 2.8.4 the pic16 *printf() and printf_tiny()
library functions supported undocumented and not standard compliant
'b' binary format specifier ("%b", "%hb"
and "%lb"). The 'b' specifier is now disabled by
default. It can be enabled by defining BINARY_SPECIFIER macro in
files device/lib/pic16/libc/stdio/vfprintf.c and device/lib/pic16/libc/stdio/printf_tiny.c
and recompiling the library.
- in versions older then 2.8.5 the unnamed bitfield structure members
participated in initialization, which is not conforming with ISO/IEC
9899:1999 standard (see section Section 6.7.8 Initialization, clause
9)
Old behavior, before version 2.8.5:
struct {
int a : 2;
char : 2;
int b : 2;
} s = {1, 2, 3};
/* s.a = 1, s.b = 3 */
New behavior:
struct {
int a : 2;
char : 2;
int b : 2;
} s = {1, 2};
/* s.a = 1, s.b = 2 */
Next: 1.5 System Requirements
Up: 1. Introduction
Previous: 1.3 Typographic conventions
Contents
Index
2008-12-05