Skip to contentSkip to conversation

Jan Kiszka : rt_print: Provide rt_puts

Xenomai-core Gilles Chanteperdrix 2 participants 4 messages Jul 31, 2011 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Review

Quoted 4 lines · GIT version control
(quoted diff) +4 -0
+int rt_puts(const char *s)
+{
+	return print_to_buffer(stdout, 0, RT_PRINT_MODE_PUTS, s, NULL);
+}

gcc for ARM chokes here: it says that NULL can not be converted to a va_list, however I try it.

Signature · 1 line
                                                                Gilles.
#2 lore raw
Quoted 8 lines · Gilles Chanteperdrix

Review

Quoted 4 lines · GIT version control
(quoted diff) +4 -0
+int rt_puts(const char *s)
+{
+	return print_to_buffer(stdout, 0, RT_PRINT_MODE_PUTS, s, NULL);
+}

gcc for ARM chokes here: it says that NULL can not be converted to a va_list, however I try it.

Hmm. Does this work?

src/skins/common/rt_print.c +3 -1
index 186de48..52538d8 100644
@@ -243,7 +243,9 @@ int rt_printf(const char *format, ...)
 
 int rt_puts(const char *s)
 {
-	return print_to_buffer(stdout, 0, RT_PRINT_MODE_PUTS, s, NULL);
+	va_list dummy;
+
+	return print_to_buffer(stdout, 0, RT_PRINT_MODE_PUTS, s, dummy);
 }
 
 void rt_syslog(int priority, const char *format, ...)

Not really beautiful as well, I know.

Jan

#3 lore raw
Quoted 29 lines · Jan Kiszka
Quoted 8 lines · Gilles Chanteperdrix

Review

Quoted 4 lines · GIT version control
(quoted diff) +4 -0
+int rt_puts(const char *s)
+{
+	return print_to_buffer(stdout, 0, RT_PRINT_MODE_PUTS, s, NULL);
+}

gcc for ARM chokes here: it says that NULL can not be converted to a va_list, however I try it.

Hmm. Does this work?

src/skins/common/rt_print.c +3 -1
index 186de48..52538d8 100644
@@ -243,7 +243,9 @@ int rt_printf(const char *format, ...)
 
 int rt_puts(const char *s)
 {
-	return print_to_buffer(stdout, 0, RT_PRINT_MODE_PUTS, s, NULL);
+	va_list dummy;
+
+	return print_to_buffer(stdout, 0, RT_PRINT_MODE_PUTS, s, dummy);
 }
 
 void rt_syslog(int priority, const char *format, ...)
Quoted 1 line

Not really beautiful as well, I know.

It seems to work now, but some later version of gcc may decide to warn us that this argument is used without being initialized...

Signature · 1 line
                                                                Gilles.
#4 lore raw
Quoted 27 lines · Gilles Chanteperdrix
Quoted 26 lines · Jan Kiszka
Quoted 8 lines · Gilles Chanteperdrix

Review

Quoted 4 lines · GIT version control
(quoted diff) +4 -0
+int rt_puts(const char *s)
+{
+	return print_to_buffer(stdout, 0, RT_PRINT_MODE_PUTS, s, NULL);
+}

gcc for ARM chokes here: it says that NULL can not be converted to a va_list, however I try it.

Hmm. Does this work?

src/skins/common/rt_print.c +3 -1
index 186de48..52538d8 100644
@@ -243,7 +243,9 @@ int rt_printf(const char *format, ...)
 
 int rt_puts(const char *s)
 {
-	return print_to_buffer(stdout, 0, RT_PRINT_MODE_PUTS, s, NULL);
+	va_list dummy;
+
+	return print_to_buffer(stdout, 0, RT_PRINT_MODE_PUTS, s, dummy);
 }
 
Quoted 7 lines
Quoted 4 lines
src/skins/common/rt_print.c +0 -0
 void rt_syslog(int priority, const char *format, ...)

Not really beautiful as well, I know.

It seems to work now, but some later version of gcc may decide to warn us that this argument is used without being initialized...

Yes. I've pushed a cleaner version.

Jan