Re: MAXIMUM_ALIGNOF on Windows-32

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема Re: MAXIMUM_ALIGNOF on Windows-32
Дата
Msg-id 20070723151252.GC5663@svr2.hagander.net
обсуждение исходный текст
Ответ на Re: MAXIMUM_ALIGNOF on Windows-32  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: MAXIMUM_ALIGNOF on Windows-32
Список pgsql-hackers
On Fri, Jul 20, 2007 at 10:32:35AM -0400, Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
> > Tom Lane wrote:
> >> Anyway, we detect this directly based on the C compiler's behavior,
> >> and you can't argue with the compiler about it.  Whatever it's
> >> doing is right by definition.
> 
> > Perhaps Pavan is referring to what is hardcoded in pg_config.h.win32 
> > which is used for MSVC builds  (but not for MinGW builds, IIRC), in 
> > which case the answer might be that in this file we need to be 
> > pessimistic about such things, since we have no reasonable way to run 
> > configure on this platform.
> 
> Somebody had better double-check that.  We don't need to be
> "pessimistic", we need to be *correct*, because the align values had
> better match the way the compiler will lay out a C struct.  Otherwise
> struct-based access to catalog rows will fail.  (I'm not sure if there
> are any system catalogs with float8 or int64 columns, but I'd sure not
> want to find out that we couldn't have one because of misconfiguration
> of MSVC builds.)

How do I double-check this?


> I see though that the comment in pg_config.h.win32 claims it was derived
> from mechanically-generated configure output, so unless that's lying
> it should be OK already. 

It's not - it started out as a copy of the output of ./configure on mingw.

> AFAIK struct alignment is part of the ABI for
> a platform and is not subject to the whims of individual compilers, so
> the result from MinGW should be OK for MSVC.

Still, it doesn't hurt to double-check.

//Magnus


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Why is lc_messages superuser only?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: syslogging oddity