yvesdm3000Beside the generic nagging about gotos etc (but I'm also realistic: I should not care about what someone does or even have to do at times!)
I'm very fastidious with respect to coding style, and I always try to find the cleanest and clearest way of doing things. Starting to use
goto's was (once) a result of a critical analysis of my C code. While I totally support most of the critics of
goto, there's one single case where it does a better job in supporting clean and clear code in C than anything else. And that's error handling. Especially when you handle resource allocation errors while allocating three or more resources in a function. That's a generally accepted application of
goto's and the only one I make use of in my code. In C++ RAII is in many cases a better alternative, but we don't have that in C.
Aside from the justification of
goto's used in a very limited way, there's indeed another argument, which you've already mentioned. That is, code completion should support possible language constructs rather than some specific coding styles. Supporting the latter could only be an optional additional bonus.
Nevertheless I think we should be able to retrieve the labels within the function scope and detect the goto statement and do code-completion ourselves.
Well, thank you for considering that option. However I expected libclang to be somewhat more clever in that respect. If it doesn't support code completion for labels, then I'd first bugreport that to the libclang developers.
I'll try to look at this case later next week.
OK. Thanks for taking your time looking into that.
This way you could force the 'view' of the header file by going to the header/source file that does some defines before the #include statement and when you would then go to the header file, you'd see it trough that translation unit.
I see this kind of implementation as a possible temporary workaround. But a drop-down or a quick popup with an assignable hotkey (like the one you have on Ctrl+Tab) seems to me more user-friendly.
GCC is the only compiler where the product compiles, nevertheless I find clangcc very usefull for code-completion
Totally. And in general you're right regarding the issues of using different compilers. However clang developers target broad compatibility with gcc, and I'm gonna find some time to report at least this little issue to the clang developers, as supporting string merging in this specific case is arguably better than not supporting, even though this goes beyond the requirements imposed by the C standard.