Re: Coding style question - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Coding style question
Date
Msg-id 454B76EB.7040009@dunslane.net
Whole thread Raw
In response to Re: Coding style question  (Nolan Cafferky <Nolan.Cafferky@qualitysmith.com>)
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: Nolan Cafferky
Date:
Subject: Re: Coding style question
Next
From: "Florian G. Pflug"
Date:
Subject: Re: [PATCHES] Bug in WAL backup documentation