Well, the ? : construct is called the ternary operator. There's a whole wikipedia page about it :
en.wikipedia.org/wiki/%3F
:
It is indeed shorthand for an if statement.
Code:
int foo;
if (condition)
foo = x;
else
foo = y;
vs.
int foo = condition ? x : y;
In some cases it makes the code easier to read, and in others, not so much. Avoid nesting them
value <optimized out> simply means that the compiler has determined that the actual value of whatever variable is not referenced in the given context, so it hasn't bothered to actually make it available. Sometimes you want - for debugging purposes, for instance - to have the values all present.
To make this work, you'll need to alter your Makefile so it doesn't trigger so much optimization. Simply remove the -O2 from your flags line.
In this case, you are likely crashing because something isn't set up correctly earlier on:
Code:
Mar 19 23:01:50 :: WARNING: Attempting to merge iterator to empty list.
Mar 19 23:01:50 :: WARNING: Attempting to remove iterator from NULL list.
Mar 19 23:01:50 :: WARNING: Attempting to remove contents that don't exist in list.
Mar 19 23:01:50 :: WARNING: Attempting to merge iterator to empty list.
Mar 19 23:01:50 :: WARNING: Attempting to remove iterator from NULL list.
Mar 19 23:01:50 :: WARNING: Attempting to remove contents that don't exist in list.
This looks quite strange to me; at this point, the lists should pretty well be pointing to
something.
If this is a reproducible crash, I'd start by recompiling, starting, and connecting gdb to the process ("gdb bin/circle", then "attach <pid>" from within gdb. Add a breakpoint at where you are seeing the problem, "break comm.c:378", and trigger the problem.
This will allow you to debug
the running code.
Interesting commands are "step" (steps into), "next" (steps over), "until" (steps over loops) and "finish" (steps out of). See
ftp.gnu.org/old-gnu/Manuals/gdb/html_node/gdb_37.html#SEC38
. Also "print" which will print the value of anything following, for instance "print pContent" and "print *pContent".
My first plan would be to "next" until I see where those log statements come from...