[sisyphus] Re: FireBird 1.0 от AltLinux будет?
Mikhail Zabaluev
=?iso-8859-1?q?mhz_=CE=C1_alt-linux=2Eorg?=
Пт Мар 15 11:45:19 MSK 2002
Hello Evgeniy,
On Fri, Mar 15, 2002 at 08:46:48AM +0300, Evgeniy Kobzev wrote:
>
> ----- Original Message -----
> From: "Mikhail Zabaluev" <mhz на alt-linux.org>
> To: <sisyphus на altlinux.ru>
> Sent: Friday, March 15, 2002 1:14 AM
> Subject: [sisyphus] Re: FireBird 1.0 от AltLinux будет?
>
>
> > Хм, сомнительный код... Не означаёт ли это, что ошибки загнаны под
> > ковёр? Можно взглянуть на код, на котором выдаются ошибки?
>
> Можно. Функция в которой ругается. Это 47 строка, и далее до 110.
> =====================================================================
> SSHORT MISC_build_parameters_block (
> UCHAR *buffer,
> ...)
> {
> /**************************************
> *
> * M I S C _ b u i l d _ p a r a m e t e r s _ b l o c k
> *
> **************************************
> *
> * Functional description
> * Stuffs the passed buffer with various argument information coming via
> * va_list. An argument type of 0 signifies the end of argument list.
> * Returns the total number of bytes put (stuffed) in the passed buffer.
> *
> **************************************/
> va_list ptr;
> UCHAR *p, *q;
> SCHAR arg_type, ch;
> USHORT sh;
> SLONG l;
>
> p = buffer;
> VA_START (ptr, buffer);
>
> /* using the argument types in the parameter list,
> pop the arguments off the call stack and put
> them into the passed buffer */
>
> while (arg_type = va_arg (ptr, SCHAR)) // <--- misc.c:76: `SCHAR' is
> promoted to `int' when passed through `...'
Вот что говорит libc.info:
The type of the value returned by `va_arg' is TYPE as specified
in
the call. TYPE must be a self-promoting type (not `char' or
`short int' or `float') that matches the type of the actual
argument.
По смыслу, нужно использовать типы, которые получаются при "возгонке"
параметров в случае, если функция не была объявлена (одна из часто
ругаемых особенностей C, если помните).
Так что стандарт есть стандарт, извольте соответствовать-с.
Не берусь судить, правильно ли gcc 2.95.3 достаёт эти параметры из
стека.
--
Stay tuned,
MhZ JID: mookid на jabber.org
___________
Wilner's Observation:
All conversations with a potato should be conducted in private.
Подробная информация о списке рассылки Sisyphus