HP C Programmer's Guide (92434-90009)

Chapter 5 147
Programming for Portability
Silent Changes for ANSI C
Empty tag declarations in a block scope create a new struct instance in ANSI mode.
The term block scope refers to identifiers declared inside a block or list of parameter
declarations in a function definition that have meaning from their point of declaration
to the end of the block. In the ANSI mode, it is possible to create recursive structures
within an inner block. For example:
struct x { int i; };
{ /* inner scope */
struct x;
struct y { struct x *xptr; };
struct x { struct y *yptr; };
}
In ANSI mode, the inner struct x declaration creates a new version of the structure
type which may then be referred to by struct y. In non-ANSI mode, the struct x;
declaration refers to the outer structure.
On Series 700/800, variable shifts (<< or >>) where the right operand has a value
greater than 31 or less than 0 will no longer always have a result of 0. For example,
unsigned int i,j = 0xffffffff,k=32;
i=j>>k; /*igets the value 0 in compatibility mode, */
/* 0xffffffff(-1) in ANSI mode. */