switch case

I am surprised that a switch without the case is not flagged as an error:

enum					// display modes for "Time lived"; 
{
	TIME_ALL = 0,		// show years, months, days, hours, minutes and seconds;
	DAYS_ONLY,
	HOURS_ONLY,
	MINUTES_ONLY
};

int mode = TIME_ALL;


void setup()
{
}


void loop()
{
  switch (mode)
  {
    TIME_ALL:
      break;

    DAYS_ONLY:
      break;

    HOURS_ONLY:
      break;

    MINUTES_ONLY:
      break;
  }
}

I think all switches without an explicit 'default' case have an implicit 'default' case just before the closing brace.

Hmm - the C standard says it differently (6.8.4.2.5):

If no converted case constant expression matches and there is no default label, no part of the switch body is executed.

I think you've missed the point - there are no "case"!
In effect, the statement reads something like

switch (x) {
0: break;
1: break;
}

I believe those end up as labels as used with 'goto'.

Yeap, this is it, they are considered labels (used for goto).
Thanks.

Hah!
Correct, in which case, (no pun intended) ignore reply#2

I am still wondering if this is correct C or it should be flagged as an error ("missing case").
I just noticed, how weird, that I have no other C compiler on my machine (as I used to years ago).
Does anyone care to test it on Visual C++ for example, see if they treat it differently?
Thanks again.

One more observation:

switch (x) {
0: break;
1: break;
}

The code above, which seems equivalent, generates an error.

Yes of course. It's ok to have no cases, but it's not ok to begin a label with a digit.

have i been typing out case every time for no reason at all... all... the... time...