Displaying 20 results from an estimated 562 matches for "va_list".
2006 Oct 05
3
[LLVMdev] Extracting all BasicBlocks of a Function into new Function
Hi,
Chris Lattner wrote:
> All the non-vastart calls can be anywhere. va_end in particular codegens
> to a noop on all targets llvm currently supports, fwiw.
>
Things go well, except for the following (pathological?) C program:
int va_double_sum(int count,...){
int i,sum=0;
va_list ap;
va_start(ap,count);
for(i=0;i<count;i++){
sum+=va_arg(ap,int);
}
va_end(ap);
va_start(ap,count);/* same vararg opened twice!!! */
for(i=0;i<count;i++){
sum+=va_arg(ap,int);
}
va_end(ap);
return sum;
}
The problematic issue here is that the va_list is opened a...
2007 Apr 02
2
[LLVMdev] Declaration of a va_list should be an intrinsic?
Hi everyone,
Currently, when declaring a va_list in llvm, one only needs to do:
%ap = alloca i8 * (Reference : llvm/docs/LangRef.html#int_varargs)
This is OK for x86 and PPC/Darwin ABI because a va_list in these architectures is
just a pointer to the stack. The va_start intrinsic just initializes where
the pointer points at in the stack. I do n...
2007 Apr 02
0
[LLVMdev] Declaration of a va_list should be an intrinsic?
On 4/2/07, Nicolas Geoffray <nicolas.geoffray at lip6.fr> wrote:
> Hi everyone,
>
> Currently, when declaring a va_list in llvm, one only needs to do:
>
> %ap = alloca i8 * (Reference : llvm/docs/LangRef.html#int_varargs)
This example is x86 specific. alpha allocas an {sbyte*, int} (and
does so in llvm-gcc). What the type of the alloca to use is requires
the frontend to know the abi of the backend. Even wi...
2017 Oct 12
1
Re: [PATCH miniexpect 2/2] Add debugging capability at runtime.
On Wednesday, 11 October 2017 17:23:45 CEST Richard W.M. Jones wrote:
> +static int
> +mexp_vprintf (mexp_h *h, int password, const char *fs, va_list args)
> {
> - va_list args;
> char *msg;
> int len;
> size_t n;
> ssize_t r;
> char *p;
>
> - va_start (args, fs);
> len = vasprintf (&msg, fs, args);
> - va_end (args);
Due to the nature of va_list (whose implementation greatly differs...
2008 Aug 27
0
[PATCH] stubdom: add v?errx? and v?warnx? functions
...36 2008 +0100
@@ -0,0 +1,15 @@
+#ifndef _POSIX_ERR_H
+#define _POSIX_ERR_H
+
+#include <stdarg.h>
+
+void err(int eval, const char *fmt, ...);
+void errx(int eval, const char *fmt, ...);
+void warn(const char *fmt, ...);
+void warnx(const char *fmt, ...);
+void verr(int eval, const char *fmt, va_list args);
+void verrx(int eval, const char *fmt, va_list args);
+void vwarn(const char *fmt, va_list args);
+void vwarnx(const char *fmt, va_list args);
+
+#endif /* _POSIX_ERR_H */
diff -r 14a9a1629590 extras/mini-os/lib/sys.c
--- a/extras/mini-os/lib/sys.c Wed Aug 27 10:26:50 2008 +0100
+++ b/extras...
2007 Apr 03
2
[LLVMdev] Declaration of a va_list should be an intrinsic?
Hi Andrew,
Andrew Lenharth wrote:
> On 4/2/07, Nicolas Geoffray <nicolas.geoffray at lip6.fr> wrote:
>
>> Hi everyone,
>>
>> Currently, when declaring a va_list in llvm, one only needs to do:
>>
>> %ap = alloca i8 * (Reference : llvm/docs/LangRef.html#int_varargs)
>>
>
> This example is x86 specific. alpha allocas an {sbyte*, int} (and
> does so in llvm-gcc). What the type of the alloca to use is requires
> the frontend...
2017 Aug 14
2
[RFC] The future of the va_arg instruction
....
>> * Alternatively, the conversion from the va_arg instruction to
>> SelectionDAG could be modified. It might be desirable to convert the
>> vaarg
>> instruction to a number of loads and a new node that is responsible
>> only for
>> manipulating the va_list struct.
>
>
> We could automatically split va_arg on an LLVM struct type into a series of
> va_arg calls for each of the elements of the struct. Not sure that actually
> helps anyone much, though.
>
> Anything more requires full type information, which isn't currently enco...
2001 Oct 18
2
Incorrect return types for snprintf() and vsnprintf()
...d-compat/bsd-snprintf.c.orig Thu Oct 18 13:57:51 2001
--- /openbsd-compat/bsd-snprintf.c Thu Oct 18 13:58:26 2001
***************
*** 632,638 ****
#endif /* !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) */
#ifndef HAVE_VSNPRINTF
! int
vsnprintf(char *str, size_t count, const char *fmt, va_list args)
{
str[0] = 0;
--- 632,638 ----
#endif /* !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) */
#ifndef HAVE_VSNPRINTF
! size_t
vsnprintf(char *str, size_t count, const char *fmt, va_list args)
{
str[0] = 0;
***************
*** 643,649 ****
#endif /* !HAVE_VSNPRINTF */
#...
2000 Feb 08
1
problem with va_list type (alpha) (PR#421)
Full_Name: Albrecht Gebhardt
Version: 0.99.0
OS: alpha, osf4.0
Submission from: (NULL) (143.205.180.40)
Both DEC cc and gcc complain (osf4.0, alpha) about applying
an unary operator (!) to a non scalar type (va_list arg) in
printutils.c
I'm not sure if I understood what was intended by "!arg" (see below),
but with this patch I at least was able to compile. (and R runs now,
but I guess only because I didn't came across this code section)
--- ./src/main/printutils.c.va_list.patch Mon Feb 7...
2006 Oct 03
0
[LLVMdev] Extracting all BasicBlocks of a Function into new Function
On Tue, 3 Oct 2006, Bram Adams wrote:
>> You'd have to change it to something like:
>> void foo(int X, ...) {
>> P = va_start();
>> bar(X, P);
>> }
>>
>> void bar(int X, valist P) {
>> use(P);
>> }
>
> Can the other va_...-intrinsics be used in bar as were the "P =
> va_start" in bar? The va_start probably is
2007 Apr 03
3
[LLVMdev] Implementing a complicated VAARG
Hi everyone,
I'm implementing varags handling for PPC32 with the ELF ABI. It is
largely more
complicated than the Macho ABI or x86 because it manipulates a struct
instead of a direct pointer in the stack. You can find the layout of the
va_list struct
at the end of this mail.
A VAARG call requires a lot of computation. Typically the C code for
va_arg(ap, int)
is:
int va_arg_gpr(ap_list ap) {
int idx = ap->gpr;
if (idx < 8) {
ap->gpr = idx + 1;
return ap->reg_save_area[idx];
}
else {
int...
2000 Mar 07
2
[Fwd: va_list problems on Solaris]
This might shed some light on the va_list problem reported previously.
-d
David Hesprich wrote:
>
> On Wed, 8 Mar 2000, Damien Miller wrote:
>
> > > log.c: In function `fatal':
> > > log.c:17: `__builtin_va_alist' undeclared (first use in this function)
> >
> > A few people have reported t...
2006 Oct 03
2
[LLVMdev] Extracting all BasicBlocks of a Function into new Function
Hi,
Op 3-okt-06, om 20:48 heeft Chris Lattner het volgende geschreven:
> You'd have to change it to something like:
>
> void foo(int X, ...) {
> P = va_start();
> bar(X, P);
> }
>
> void bar(int X, valist P) {
> use(P);
> }
Can the other va_...-intrinsics be used in bar as were the "P =
va_start" in bar? The va_start probably is unnecessary
2017 Aug 09
4
[RFC] The future of the va_arg instruction
...g
The va_arg instruction is described in the language reference here
<http://llvm.org/docs/LangRef.html#int-varargs> and here
<http://llvm.org/docs/LangRef.html#i-va-arg>. When it's possible to use
va_arg, it frees the frontend from worrying about manipulation of the
target-specific va_list struct. This also has the potential to make analysis
of the IR more straight-forward. However, va_arg can't currently be used
with an aggregate type (such as a struct). The difficulty of adding support
for aggregates is discussed later in this email.
Which Clang targets generate va_arg?
* PNaC...
2020 Mar 26
0
[PATCH nbdkit 2/9] server: Rename replacement vfprintf function.
...ver/internal.h b/server/internal.h
index e39db8a8..e5c7f514 100644
--- a/server/internal.h
+++ b/server/internal.h
@@ -298,16 +298,18 @@ extern void apply_debug_flags (void *dl, const char *name);
extern void free_debug_flags (void);
/* log-*.c */
+extern void log_stderr_verror (const char *fs, va_list args)
+ __attribute__((__format__ (printf, 1, 0)));
+extern void log_syslog_verror (const char *fs, va_list args)
+ __attribute__((__format__ (printf, 1, 0)));
+
+/* vfprintf.c */
#if !HAVE_VFPRINTF_PERCENT_M
#include <stdio.h>
-#define vfprintf nbdkit_vfprintf
-extern int nbdkit_vfprintf...
2000 Jun 27
1
openssh-2.1.1p1 on Irix6.2 report
.../include -I/usr/local/ssl/include -DETCDIR=\"/usr/local/etc\" -DSSH_PROGRAM=\"/usr/local/bin/ssh\" -DSSH_ASKPASS_DEFAULT=\"/usr/local/libexec/ssh/ssh-askpass\" -DHAVE_CONFIG_H -c bsd-snprintf.c
"bsd-snprintf.c", line 149: warning(1164): argument of type "va_list *" is
incompatible with parameter of type "char *"
ret = vsprintf(p, fmt, ap);
^
"bsd-snprintf.c", line 176: warning(1177): argument is incompatible with
formal parameter
return (vsnprintf(str, n, fmt, ap));...
2013 Nov 19
0
[LLVMdev] construct va_list from llvm::Instruction
Hi,
I'm trying to write some forward constant propagation of sprintf and friends,
and I need a way to construct a (build) va_list from the IR of a
variadic function
so that I can evaluate it at build time.
I can't find a standard way of doing this.
--
---
Shawn Landden
+1 360 389 3001 (SMS preferred)
2020 Mar 26
0
[PATCH nbdkit 3/9] server: Add log_verror function.
...ndex e5c7f514..b43798ff 100644
--- a/server/internal.h
+++ b/server/internal.h
@@ -297,6 +297,9 @@ extern void add_debug_flag (const char *arg);
extern void apply_debug_flags (void *dl, const char *name);
extern void free_debug_flags (void);
+/* log.c */
+extern void log_verror (const char *fs, va_list args);
+
/* log-*.c */
extern void log_stderr_verror (const char *fs, va_list args)
__attribute__((__format__ (printf, 1, 0)));
diff --git a/server/log.c b/server/log.c
index 73493563..37de3dd2 100644
--- a/server/log.c
+++ b/server/log.c
@@ -40,11 +40,11 @@
#include "internal.h"...
2006 Oct 05
1
[LLVMdev] Extracting all BasicBlocks of a Function into new Function
Hi,
Op 5-okt-06, om 16:05 heeft Ryan Brown het volgende geschreven:
> I don't know if that's valid but what about something like this:
> int va_double_sum(int count,...){
> /*declare va_list for each original va_start*/
> /*llvm.va_start for each va_list*/
> /*call extracted_sum(count,va_list1, va_list2, ...)*/
> }
That should work, I think, ...
Op 5-okt-06, om 20:51 heeft Chris Lattner het volgende geschreven:
> Why not va_copy the input valist?
... and so would this...
2006 May 17
1
Need a little help with the pure Ruby win32-eventlog
...re are the problems:
* I don''t think I''m advancing the EVENTLOGRECORD properly between
iterations. Take a look at the end of the "while dwread > 0" loop. I
get some records, but not all of them.
* I''m not sure how to properly populate or pack/unpack the va_list,
which is later passed to the FormatMessage() function.
Please take a look.
Thanks,
Dan