I'm pretty sure this is just the compiler getting confused. Obviously if root
is NULL it doesn't go through the else part with while loop at all, and if root
is not NULL, then trailCurrent
will always be set to something as it must go through the loop at least once.
If it was me, I would just initialize trailCurrent
to root
(or NULL), once I was sure the warning was not correct.