Why "global" variable can't be processed properly?

John (Eljay) Love-Jensen eljay@adobe.com
Wed Apr 29 15:20:00 GMT 2009


Hi horde,

> I used C in multi platforms many years and never encountered this unspecified

It is not unspecified behavior.

It is specified as undefined behavior.

> I hope GCC can be consistent with the others. Maybe that's a better way.

I do not think that is a better way.

I think it is better to not rely on the behavior of a particular compiler
for language undefined behavior.

It would be nice if the compiler could ALWAYS warn about code that has
undefined behavior.

In some situations compilers do (or can) warn, but it is not possible to
detect all situations where the code has undefined behavior for some
languages (such as C).  Alas.

Sincerely,
--Eljay



More information about the Gcc-help mailing list