Re: POLA violation with \c service= - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: POLA violation with \c service=
Date
Msg-id 54B13C10.1030601@dunslane.net
Whole thread Raw
In response to Re: POLA violation with \c service=  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: POLA violation with \c service=
List pgsql-hackers
On 01/10/2015 09:32 AM, Andres Freund wrote:
> On 2015-01-10 09:16:07 -0500, Andrew Dunstan wrote:
>>     +static const char uri_designator[] = "postgresql://";
>>     +static const char short_uri_designator[] = "postgres://";
>>
>> These declarations in common.h would cause a separate instance of these
>> pieces of storage to occur in every object file where the .h file had been
>> #included. In general, you should not expect to see any static declarations
>> in .h files.
> Save static inline functions, that is.
>



Yeah, but not normally data items. (I did say "in general"). As a 
general rule for novice C programmers I think my rule of thumb is 
reasonable.

cheers

andrew



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: POLA violation with \c service=
Next
From: Andres Freund
Date:
Subject: Re: POLA violation with \c service=