Strange shifting behaviour

Eljay Love-Jensen eljay@adobe.com
Tue Jul 12 22:44:00 GMT 2005


Hi Ulf,

>When shifting an int by its size in bits...

That is undefined behavior (implementation dependent), as per C and C++ standards.  Ever since C was first taking it's first baby steps.

By "undefined behavior", that means any given particular implementation can:
+ not do anything
+ do what you expect
+ SEGV
+ format your hard drive

--Eljay



More information about the Gcc-help mailing list