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 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 w

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 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 :

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 is

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

2009-01-14 Thread Gregory Stark
"Robert Haas" 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 it's kind of

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 wrote: > Bruce Momjian 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

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 Tom Lane
Bruce Momjian 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 portable: they work

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

2009-01-14 Thread Tom Lane
Martijn van Oosterhout 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. Wrong. W

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 a

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

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 tol

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 function

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 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 sh