miniscule compiler barf in pg_ctl.c - Mailing list pgsql-hackers

From Dann Corbit
Subject miniscule compiler barf in pg_ctl.c
Date
Msg-id 54798A299E68514AB7C4DEBA25F03BE101BBAA@postal.corporate.connx.com
Whole thread Raw
Responses Re: miniscule compiler barf in pg_ctl.c  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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); */
 }

pgsql-hackers by date:

Previous
From: "Dann Corbit"
Date:
Subject: Missing header in zic.c?
Next
From: Hans-Jürgen Schönig
Date:
Subject: Re: parameter hints to the optimizer