This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
optind
- From: Baurjan Ismagulov <ibr at ata dot cs dot hun dot edu dot tr>
- To: gdb at sources dot redhat dot com
- Date: Wed, 10 Dec 2003 16:20:47 +0200
- Subject: optind
Hello,
given the following program:
#include <unistd.h>
int main()
{
printf("%p\n", &optind);
}
I do:
gcc -g a.c
./a.out
nm a.out |grep optind
I see, respectively:
0x80495ac
080495ac B optind@@GLIBC_2.0
After that I do:
gdb a.out
b main
r
p &optind
I see:
$1 = (int *) 0x4014814c,
whereas I expect it to be 080495ac. Naturally, "p optind" displays
another value, too. What is going on?
Thanks in advance,
Baurjan.