Peter Julian wrote:[color=blue]
> "Levent" <sly5@pitt.edu> wrote in message
> news:d7k99h$391$1@usenet01.srv.cis.pitt.edu...
>[color=green]
>>Hi,
>>
>>When compiled with gcc 3.3.3 and lower on various systems (tried cygwin,
>>linux, aix) the following code behaves strangely:[/color]
>
>
> Well, then give gcc the prize becuse the other compilers failed the task.
>[/color]
If you were right that the behavior of this code is undefined, it
wouldn't follow that any compiler failed in any way. Undefined behavior
is simply undefined. The language definition does not require any
particular behavior, so anything a compiler does is okay.
[color=blue]
>[color=green]
>>#include <iostream>
>>
>>class Foo {
>>public:
>> typedef int subs[3];[/color]
>
>
> undefined behaviour, an array object is not an integer nor can it ever be.
> typedef is meant to create a new type definition, not to act like a pointee
> converter.
>[/color]
The typedef says that 'subs' is an array of 3 ints.
--
Pete Becker
Dinkumware, Ltd. (
http://www.dinkumware.com)