This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: missed uninitialised variable warning


Alexandre Oliva <aoliva@redhat.com> writes:

| On Aug  4, 2003, Gabriel Dos Reis <gdr@integrable-solutions.net> wrote:
| 
| >   unsigned char c = c;
| 
| Actually, I *think* this invokes undefined behavior, because you use
| an uninitialized value.  This is quite different from:

No.  The reason is that there is no trap representation for unsigned
char.   You can safely read an uninitialized unsigned char -- you just
get "random"  bit patterns.

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]