This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB 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]

[Bug c++/9580] printing negative values of constant values (withvalue 128-255)


http://sourceware.org/bugzilla/show_bug.cgi?id=9580

John T. Kerich <john.t.kerich at nasa dot gov> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |john.t.kerich at nasa dot
                   |                            |gov

--- Comment #2 from John T. Kerich <john.t.kerich at nasa dot gov> 2011-08-10 15:53:40 UTC ---
#include <stdio.h>

static const int z = 128;
static int y = 128;

int main( int argc, char * argv [] )
{
    int ret = 0;

    printf( "%d\n", z );

    return( ret );
}

g++ -c -I. -g -Wall testNeg.C -o testNeg.o
testNeg.C:4: warning: 'y' defined but not used
g++ -MM -I. -g -Wall testNeg.C > .deps/testNeg.d
g++ -o testNeg testNeg.o                 

(gdb) run
Starting program: /home/jkerich/CC_tools/testNeg 
warning: no loadable sections found in added symbol-file system-supplied DSO at
0x2aaaaaaab000
128

Breakpoint 1, main (argc=1, argv=0x7fffffffe1b8) at testNeg.C:12
12          return( ret );
(gdb) print z
$1 = -128
(gdb) print y
$2 = -128
(gdb) quit

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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