View Single Post

   
  #2 (permalink)  
Old 04-12-2008, 05:32 AM
Andrew Dunstan
 
Posts: n/a
Default Re: Coding style question

Nolan Cafferky wrote:
>
> This may not inform the current conversation at all, but a while back
> I went on a cross-compiler compatibility binge for all of my active
> projects, and I found that some compilers (*cough* Borland *cough) had
> some very strange compiler/run time errors unless all variables were
> declared at the top of the function, before any other code gets
> executed. For better or for worse, I started strictly declaring all
> variables in this manner, with initialization happening afterward, and
> the behavior has stuck with me. I don't know whether any compilers
> used for postgres builds still have this issue - it's been a few years.


We expect the compiler to be C89 compliant at a minimum. If it rejects
simple initialisation in the declarations or variables declared in an
inner scope then it's hopeless for our purposes, surely. We have lots of
such code.

cheers

andrew

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Reply With Quote