When trying to debug my implementation of server.c, asking gdb to print out the variable
line results in a
(gdb) p line
After doing a bit of research with google, the value in a variable is optimized out if its never used again in the rest of the code. But it is still needed many times throughout the rest of the code, like:
strncpy(mthd, line, spc1 - line);
mthd[spc1 - line] = '\0';
So why is it being optimized out? Does the variable
line have to be used in a particular way for it to not be optimized out? Or could it be a bug in the optimizer?