Re: [HACKERS] Updates of SE-PostgreSQL 8.4devel patches (r1403)

2009-01-14 Thread KaiGai Kohei
Martijn van Oosterhout wrote: On Tue, Jan 13, 2009 at 10:05:45AM -0300, Alvaro Herrera wrote: pgace.h: you have a bunch of static inline functions in here. As far as I know this doesn't work in compilers other than GCC :-( See pg_list.h (list_head) for an example. I think we can tolerate

Re: [HACKERS] Updates of SE-PostgreSQL 8.4devel patches (r1403)

2009-01-14 Thread Alvaro Herrera
Martijn van Oosterhout wrote: On Tue, Jan 13, 2009 at 10:05:45AM -0300, Alvaro Herrera wrote: pgace.h: you have a bunch of static inline functions in here. As far as I know this doesn't work in compilers other than GCC :-( See pg_list.h (list_head) for an example. I think we can tolerate

Re: [HACKERS] Updates of SE-PostgreSQL 8.4devel patches (r1403)

2009-01-14 Thread Bruce Momjian
KaiGai Kohei wrote: Martijn van Oosterhout wrote: On Tue, Jan 13, 2009 at 10:05:45AM -0300, Alvaro Herrera wrote: pgace.h: you have a bunch of static inline functions in here. As far as I know this doesn't work in compilers other than GCC :-( See pg_list.h (list_head) for an example. I

Re: [HACKERS] Updates of SE-PostgreSQL 8.4devel patches (r1403)

2009-01-14 Thread Tom Lane
Martijn van Oosterhout klep...@svana.org writes: On Tue, Jan 13, 2009 at 10:05:45AM -0300, Alvaro Herrera wrote: pgace.h: you have a bunch of static inline functions in here. As far as I know this doesn't work in compilers other than GCC :-( Really? C99 requires it and MSVC does support it.

Re: [HACKERS] Updates of SE-PostgreSQL 8.4devel patches (r1403)

2009-01-14 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: KaiGai Kohei wrote: However, it also seems to me that PostgreSQL implementation tend to avoid to use inline functions actively. I thought one advantage of using macros is that we force the inlining, The (only) good thing about macros is they're

Re: [HACKERS] Updates of SE-PostgreSQL 8.4devel patches (r1403)

2009-01-14 Thread KaiGai Kohei
Tom Lane wrote: If you ran the current sepostgres patch through an actual C99 compiler, it would fail. The current one (r1408) is reworked to use normal functions, and inlines are eliminated. :-) http://code.google.com/p/sepgsql/source/browse/trunk/sepgsql/src/include/security/sepgsql.h

Re: [HACKERS] Updates of SE-PostgreSQL 8.4devel patches (r1403)

2009-01-14 Thread Robert Haas
On Wed, Jan 14, 2009 at 10:00 AM, Tom Lane t...@sss.pgh.pa.us wrote: Bruce Momjian br...@momjian.us writes: KaiGai Kohei wrote: However, it also seems to me that PostgreSQL implementation tend to avoid to use inline functions actively. I thought one advantage of using macros is that we force

Re: [HACKERS] Updates of SE-PostgreSQL 8.4devel patches (r1403)

2009-01-14 Thread Gregory Stark
Robert Haas robertmh...@gmail.com writes: Just out of curiosity, does C89, or whatever standard we follow, allow this? int somefunc(int x) { int foo[x]; /* use foo[] for scratch space */ } It's not in C89 but look up alloca. We don't use it anywhere in postgres currently so

Re: [HACKERS] Updates of SE-PostgreSQL 8.4devel patches (r1403)

2009-01-14 Thread Robert Haas
It's not in C89 but look up alloca. I know about alloca... We don't use it anywhere in postgres currently so it's kind of unlikely we would start now. :-( Obviously this is a bad plan if x can be a big number because you might crash your stack, but suppose we know that's not an issue? It

Re: [HACKERS] Updates of SE-PostgreSQL 8.4devel patches (r1403)

2009-01-14 Thread Martijn van Oosterhout
On Wed, Jan 14, 2009 at 09:52:20AM -0500, Tom Lane wrote: Martijn van Oosterhout klep...@svana.org writes: On Tue, Jan 13, 2009 at 10:05:45AM -0300, Alvaro Herrera wrote: pgace.h: you have a bunch of static inline functions in here. As far as I know this doesn't work in compilers other

Re: [HACKERS] Updates of SE-PostgreSQL 8.4devel patches (r1403)

2009-01-14 Thread KaiGai Kohei
Martijn van Oosterhout wrote: On Wed, Jan 14, 2009 at 09:52:20AM -0500, Tom Lane wrote: Martijn van Oosterhout klep...@svana.org writes: On Tue, Jan 13, 2009 at 10:05:45AM -0300, Alvaro Herrera wrote: pgace.h: you have a bunch of static inline functions in here. As far as I know this doesn't

Re: [HACKERS] Updates of SE-PostgreSQL 8.4devel patches (r1403)

2009-01-13 Thread Alvaro Herrera
KaiGai Kohei wrote: I updated patch set of SE-PostgreSQL and related stuff (r1403). [1/5] http://sepgsql.googlecode.com/files/sepostgresql-sepgsql-8.4devel-3-r1403.patch Random observations: heapam.c: you've got a bunch of elog(ERROR) calls in there that should be ereport(ERROR), and

Re: [HACKERS] Updates of SE-PostgreSQL 8.4devel patches (r1403)

2009-01-13 Thread KaiGai Kohei
Alvaro Herrera wrote: KaiGai Kohei wrote: I updated patch set of SE-PostgreSQL and related stuff (r1403). [1/5] http://sepgsql.googlecode.com/files/sepostgresql-sepgsql-8.4devel-3-r1403.patch Random observations: Thanks for your comment! heapam.c: you've got a bunch of elog(ERROR) calls

Re: [HACKERS] Updates of SE-PostgreSQL 8.4devel patches (r1403)

2009-01-13 Thread Martijn van Oosterhout
On Tue, Jan 13, 2009 at 10:05:45AM -0300, Alvaro Herrera wrote: pgace.h: you have a bunch of static inline functions in here. As far as I know this doesn't work in compilers other than GCC :-( See pg_list.h (list_head) for an example. I think we can tolerate this for the three functions in