Compiler - 'unreachable statement' leads to abort?

17 Nov 2010

I'm trying to compile the rapidxml library (rapidxml.sf.net). When compiling, I get multiple 'Statement is unreachable' warnings, each followed by several informational messages where this happens.

After the 3rd warning, the compiler aborts with:

Ignoring further errors

Unable to download

 

Why do warning messages lead to a compiler abort? Or is unreachable code internally handled as error, and the messages are wrong? If this is the case, how can I avoid that? The places in question are C++ template instantiations, so I cannot change them...

 

Thanks,

 

hli

17 Nov 2010

Try disabling the warning as described here.

18 Nov 2010

Thanks, that did the trick. Now I have 2 XML-libraries running on the mbed :)

26 Nov 2019

It is a compile-time error if a statement cannot be executed because it is unreachable. This means that the control flow of your program can't get to that statement, but you assume that they would be. The compiler analyzes the flow, and reports these statements to you as error messages. It is a reliable indicators of logical error in your program.