Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* va_list on OSF1/DEC C compiler
@ 1993-12-15 19:58 Guojun Jin[ITG]
  1993-12-16  1:51 ` John T. Kohl
  1993-12-20  3:29 ` Christos Zoulas
  0 siblings, 2 replies; 3+ messages in thread
From: Guojun Jin[ITG] @ 1993-12-15 19:58 UTC (permalink / raw)


I am frustrating to use va_list on OSF1/DEC ALPHA C compiler.  The va_list
must be used alone without any argument on the protocol list.  Other compilers
all use this format:

	func_or_proc(a1, a2, ..., an, va_alist)
	...
	{
	...
	}

However, the OSF1/DEC ALPHA C compiler does not allow other arguments go on
protocol line with va_list:

	func_or_proc_alpha(va_alist)
	va_dcl
	{
	...
	}

Of course, there is no complaining for first format, but it does not work
at all.  I don't know it is because the OSF1/DEC ALPHA C lib uses a special
va_list structure in both varargs.h and stdarg.h:

#ifndef _VA_LIST
#define _VA_LIST
typedef struct {
        char    *a0;            /* pointer to first homed integer arg */
        int     offset;         /* byte offset of next param */
} va_list;
#endif  /* _VA_LIST */
 
or there is a bug in its C compiler.

If we hope either OSF/DEC to fix it, to whom should we send request?

Thanks for any advises,


/---------------------------------------v-------------------------------\
|	Jin Guojun, Imaging Technology	| Internet: g_jin@lbl.gov	|
|	Lawrence Berkeley Laboratory	| Usenet: ucbvax!g_jin@lbl.gov	|
|			| Bitnet:	jin%george.lbl.gov@Csa3.LBL.Gov	|


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: va_list on OSF1/DEC C compiler
  1993-12-15 19:58 va_list on OSF1/DEC C compiler Guojun Jin[ITG]
@ 1993-12-16  1:51 ` John T. Kohl
  1993-12-20  3:29 ` Christos Zoulas
  1 sibling, 0 replies; 3+ messages in thread
From: John T. Kohl @ 1993-12-16  1:51 UTC (permalink / raw)


It looks like you're confusing <stdarg.h> and <varargs.h> style variatic
function declaration rules.

You probably want to use the <stdarg.h> style variatic functions (the
ANSI C versions), which means something like:

void
xxprint(int err, char *s, ...)
{
    va_list vl;
    va_start(vl, s);
    arg1 = va_arg(vl, type1);
    arg2 = va_arg(vl, type2);
    ...

    va_end(vl);
}
--
John Kohl <jtk@atria.com> or <jtkohl@mit.edu>
working for but not representing:	Atria Software
---------
What are you pretending not to know?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: va_list on OSF1/DEC C compiler
  1993-12-15 19:58 va_list on OSF1/DEC C compiler Guojun Jin[ITG]
  1993-12-16  1:51 ` John T. Kohl
@ 1993-12-20  3:29 ` Christos Zoulas
  1 sibling, 0 replies; 3+ messages in thread
From: Christos Zoulas @ 1993-12-20  3:29 UTC (permalink / raw)


In article <2enq89$bqp@overload.lbl.gov> jin@gracie.lbl.gov (Guojun Jin[ITG]) writes:
>I am frustrating to use va_list on OSF1/DEC ALPHA C compiler.  The va_list
>must be used alone without any argument on the protocol list.  Other compilers
>all use this format:
>
>	func_or_proc(a1, a2, ..., an, va_alist)
>	...
>	{
>	...
>	}
>
>However, the OSF1/DEC ALPHA C compiler does not allow other arguments go on
>protocol line with va_list:
>
>	func_or_proc_alpha(va_alist)
>	va_dcl
>	{
>	...
>	}
>

[stuff deleted]

>or there is a bug in its C compiler.
>
>If we hope either OSF/DEC to fix it, to whom should we send request?
>
>Thanks for any advises,

This is not a bug! The bug is in your code. The only guaranteed working 
form of varargs is when va_list is the one and only argument.

christos


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1993-12-20  3:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1993-12-15 19:58 va_list on OSF1/DEC C compiler Guojun Jin[ITG]
1993-12-16  1:51 ` John T. Kohl
1993-12-20  3:29 ` Christos Zoulas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox