i got some strange bugs on my system and when i've tried to find out whats the problem i arrive to the attached small example. when i compile it this way: g++ pom.c -Wall -g -Wextra then i launch gdb(6.7.1-r3) and set arguments this way: set args 0.7 0 10000 10 when i come to the lines: double alpha=0.1; alpha=atof(argv[1]); variable doesn't change its value at all. can anybody reproduce it? Reproducible: Always Steps to Reproduce:
Created attachment 166829 [details] file.c
perhaps there is nothing wrong with the gcc, only gdb does not recognize it has been compiled via g++. gcc compilation is ok, and printf of alpha works also ok.
The reason for this is that your program contains the variable "alpha" twice. If you are not lucky enough gdb prints the wrong one with "print alpha". You can see them both with "info locals". Rename one of your alpha's and you get what you expect.
aha, so this is not a bug; i will close it then.