Question

I'm using Eclipse CDT on Windows. I should add that I'm delighted, overall, with the auto-format feature.

But one thing bugs me.

I can't figure out how to configure Eclipse to not indent lines with labels.

This is what I want:

void myfunc() {
    goto MYLABEL;

MYLABEL:
    return;
}

but what I get is this:

void myfunc() {
    goto MYLABEL;

    MYLABEL:
    return;
}

How can I configure Eclipse to get exactly what I want?

In Code Style --> Formatter, there's no section for "labels" under "Indentation".

Was it helpful?

Solution

This is a bug in eclipse. I filed it in 2009 and it has yet to be fixed.

The C/C++ development tools plugin seems to be very poorly maintained, as I have quite a few bugs and enhancement requests outstanding which have languished for years.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=268404

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top