At the moment I'm evaluating the Keil5 ide. In Coocox the compiler will gray out the unused preprocessor code, is very handy. Can't find this option in Keil uvision 5, how do you guys do that? How can you read (and understand) the code if you don't know what's used or not.
Example: my.st.com/.../gray.PNG
Note that it is not the compiler which does this - it is the Editor (which is the Eclipse editor, in the Case of CooCox).
Yes, it is very handy - and has been a common (one might go so far as to say, "standard"?) feature of "proper" Programmer's editors for many years now.
Sadly, the uVision editor is pretty lame - and this is one of those handy features that it still lacks.
But, as others have said, you are not compelled to use the uVision editor.
Whether you feel that this is an unforgivable omission (considering the price of Keil tools relative to, say, CooCox) is entirely up to you ...
Usually I just have the compiler generate browse information, and look at the areas where I can vs can't set break-points, it's pretty apparent then if code doesn't make it into the executable due to preprocessor or dead-code elimination.
Use a better editor or static-analysis tool, not sure any vendor yet has built an editor that appeals to everyone, and there are hooks to let you use your own.
nor even one that completely pleases anyone for all purposes?
I generally use 2 or 3 editors as I find each one has particular features & weaknesses that make it better/worse for specific tasks.
In uVision, if you have some text selected and choose 'Print' - it will default to printing just the selection. This is very handy.
In Eclipse, it will print the entire file.
In CooCox, I can't even see a 'Print' option on any menu or toolbar - you just have to know the Ctrl+P shortcut...
Yes, very handy - when it works !
However, Eclipse in general (which, presumably, includes CooCox) does seem to have a way to get confused about it and mess it all up - and that, then, becomes a big pain!