Re: Identifying a structure by reading it's first field.



On 6/2/2012 11:30 AM, Chris Vine wrote:

In part because it wasn't in the standard prior to C99,

It was in C89 - §6.3:

Yes, you're right.

C99 added the 'restrict' keyword.

It is the fifth bullet point which permits your usage.

Not my usage, but yes, along with "A pointer to a structure object,
suitably converted, points to its initial member..." (6.5.2.1).

Not many 1990-vintage compilers used strict aliasing for optimization,

Actually, most could, as I recall.  The addition of 'restrict' was
merely standardizing a common compiler extension.

- Ernie                                  http://home.comcast.net/~erniew




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]