Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
uninitialized memory read
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Eric Sosman, post: 3809897"] That seems odd. Stripped of obfuscation, the line is merely unsigned int mask = (unsigned int)~(0xffffffff << 5); It is conceivable that the arithmetic in this initialization would be undefined (for example, on a 36-bit system), but on the far more common 32-bit machines it's just unsigned int mask = 0x1fu; .... which should be unobjectionable. However, the next two line is suspect. The "%d" specifier requires a plain `int' value to convert, and you're feeding it an `unsigned int' instead. This produces undefined behavior, which on most systems nowadays turns out to be nothing worse than bad-looking output. But under a debugging environment like Purify, perhaps the consequences are more severe. Are you sure you've correctly identified the line Purify is unhappy about? Might it be complaining about the printf() and not the initialization that immediately precedes it? Possibly. What does your IBM Support person think? [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
uninitialized memory read
Top