Re: [HACKERS] libpq-dev: pg_config_manual.h redefines CACHE_LINE_SIZE

2014-10-01 Thread Andres Freund
On 2014-09-30 21:57:56 +0200, Christoph Berg wrote:
> Hi,
> 
> there's a #define clash between pg_config_manual.h and FreeBSD's
> /usr/include/machine-amd64/param.h which also defines CACHE_LINE_SIZE.
> 
> It's probably not really a PostgreSQL bug, but it seems easy enough to
> rename that definition now as it's only present in 9.4+. It's only
> used in one file, xlog.c: 375d8526f2900d0c377f44532f6d09ee06531f67

Changed in 9.4/master.

Thanks.

Andres Freund

-- 
 Andres Freund http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] libpq-dev: pg_config_manual.h redefines CACHE_LINE_SIZE

2014-09-30 Thread Andres Freund
On 2014-09-30 13:42:11 -0700, Peter Geoghegan wrote:
> On Tue, Sep 30, 2014 at 12:57 PM, Christoph Berg  wrote:
> > It's probably not really a PostgreSQL bug, but it seems easy enough to
> > rename that definition now as it's only present in 9.4+. It's only
> > used in one file, xlog.c: 375d8526f2900d0c377f44532f6d09ee06531f67
> 
> 
> I agree. It should be renamed to PG_CACHE_LINE_SIZE.

Agreed. Unless somebody protests I'll do so tomorrow.

Greetings,

Andres Freund

-- 
 Andres Freund http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] libpq-dev: pg_config_manual.h redefines CACHE_LINE_SIZE

2014-09-30 Thread Peter Geoghegan
On Tue, Sep 30, 2014 at 12:57 PM, Christoph Berg  wrote:
> It's probably not really a PostgreSQL bug, but it seems easy enough to
> rename that definition now as it's only present in 9.4+. It's only
> used in one file, xlog.c: 375d8526f2900d0c377f44532f6d09ee06531f67


I agree. It should be renamed to PG_CACHE_LINE_SIZE.

-- 
Peter Geoghegan


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


[HACKERS] libpq-dev: pg_config_manual.h redefines CACHE_LINE_SIZE

2014-09-30 Thread Christoph Berg
Hi,

there's a #define clash between pg_config_manual.h and FreeBSD's
/usr/include/machine-amd64/param.h which also defines CACHE_LINE_SIZE.

It's probably not really a PostgreSQL bug, but it seems easy enough to
rename that definition now as it's only present in 9.4+. It's only
used in one file, xlog.c: 375d8526f2900d0c377f44532f6d09ee06531f67

Christoph
-- 
c...@df7cb.de | http://www.df7cb.de/
--- Begin Message ---
Package: libpq-dev
Version: CACHE_LINE_SIZE
Severity: normal

Hi,

pg_config_manual.h redfines CACHE_LINE_SIZE in sys/param.h on kfreebsd:

  /usr/include/postgresql/pg_config_manual.h:219:0: error: "CACHE_LINE_SIZE" 
redefined [-Werror]
   #define CACHE_LINE_SIZE  128
   ^
  In file included from /usr/include/machine/param.h:8:0,
   from /usr/include/sys/kglue/sys/param.h:143,
   from /usr/include/sys/kern/param.h:1,
   from /usr/include/osreldate.h:1,
   from /usr/include/x86_64-kfreebsd-gnu/bits/param.h:36,
   from /usr/include/x86_64-kfreebsd-gnu/sys/param.h:31,
   from collectd.h:214,
   from postgresql.c:39:
  /usr/include/machine-amd64/param.h:97:0: note: this is the location of the 
previous definition
   #define CACHE_LINE_SIZE  (1 << CACHE_LINE_SHIFT)
   ^

This causes build-errors when using -Werror. I assume that this is a
rather unusual use-case, thus didn't mark this RC.

Currently, it causes FTBFSs for collectd on kfreebsd-*, see e.g.

I hope, I'll be able to work around it using -Wp,-w there.

Cheers,
Sebastian

-- 
Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety. -- Benjamin Franklin



signature.asc
Description: Digital signature
--- End Message ---

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers