I have seen this before with other compilers.  The latest MINGW GCC
compiler does not like a goto label with no statements following.
pg_ctl.c: In function `pgwin32_ServiceMain':
pg_ctl.c:991: error: label at end of compound statement
make[3]: *** [pg_ctl.o] Error 1
make[3]: Leaving directory `/u/postgresql-snapshot/src/bin/pg_ctl'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/u/postgresql-snapshot/src/bin'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/u/postgresql-snapshot/src'
make: *** [all] Error 2

Fix is simple, add an empty statement:
 
 switch (ret)
 {
  case WAIT_OBJECT_0: /* shutdown event */
   kill(postmasterPID,SIGINT);
   WaitForSingleObject(postmasterProcess,INFINITE);
   break;
 
  case (WAIT_OBJECT_0+1): /* postmaster went down */
   break;
 
  default:
    ;  /* <<<<<<<<<< Just a semicolon added here <<<<<<<<<<<< */
   /* assert(false); */
 }

Message



I have seen this 
before with other compilers.  The latest MINGW GCC compiler does not like a 
goto label with no statements following.
pg_ctl.c: In 
function `pgwin32_ServiceMain':pg_ctl.c:991: error: label at end of compound 
statementmake[3]: *** [pg_ctl.o] Error 1make[3]: Leaving directory 
`/u/postgresql-snapshot/src/bin/pg_ctl'make[2]: *** [all] Error 
2make[2]: Leaving directory `/u/postgresql-snapshot/src/bin'make[1]: *** 
[all] Error 2make[1]: Leaving directory 
`/u/postgresql-snapshot/src'make: *** [all] Error 2
Fix is simple, add 
an empty statement:
 
 switch 
(ret) {  case WAIT_OBJECT_0: /* shutdown event 
*/   kill(postmasterPID,SIGINT);   WaitForSingleObject(postmasterProcess,INFINITE);   break;
 
  case 
(WAIT_OBJECT_0+1): /* postmaster went down 
*/   break;
 
  default:    ;  
/* <<<<<<<<<< Just a semicolon added here 
<<<<<<<<<<<< */   /* 
assert(false); */ }
Wed, 21 Jul 2004 11:36:47 -0700
"Dann Corbit" <DCorbit@connx.com>
miniscule compiler barf in pg_ctl.c
"Dann Corbit" <DCorbit@connx.com> writes:
>   default:
>     ;  /* <<<<<<<<<< Just a semicolon added here <<<<<<<<<<<< */
>    /* assert(false); */
>  }

Personally I prefer writing

	default:
		break;

Switch branches that don't have break or return at the end are trouble
waiting to happen, compiler glitches or no ...

Patched, thanks!

			regards, tom lane

Wed, 21 Jul 2004 21:46:14 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: miniscule compiler barf in pg_ctl.c 