[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#508114: fails to build on alpha



* Sune Vuorela | 2008-12-08 01:48:37 [+0100]:

>client.c: In function 'jack_client_open_aux':
>client.c:972: error: used struct type value where scalar is required
>client.c: In function 'jack_client_new':
>client.c:1120: error: incompatible type for argument 4 of 
>'jack_client_open_aux'

Sune, could you compile test this patch on Alpha please? It should fix
the two gcc errors I was in the buildd log. I cc the upstream mailing
list for correctness of the patch.

>/Sune
Sebastian

---
Subject: Fix va_list related build error on Alpha

ack-audio-connection-kit-0.115.6 does not build on Alpha due to abuse of
va_list [1]

|client.c: In function 'jack_client_open_aux':
|client.c:972: error: used struct type value where scalar is required
|client.c: In function 'jack_client_new':
|client.c:1120: error: incompatible type for argument 4 of 
|'jack_client_open_aux'

va_list is only valid between va_start() and va_end() and should not be
used as scalar. Unfortunately only the alpha compiler complains.
This patch has been only compile tested on amd64 and it should address
the two compile errors in debian bug report #508114 [2].

Could upstream please verify the correctness of this patch?

Sebastian

[1] http://buildd.debian.org/fetch.cgi?pkg=jack-audio-connection-kit;ver=0.115.6-1;arch=alpha;stamp=1228082671/gcc
[2] http://bugs.debian.org/508114
--- a/jack/varargs.h
+++ b/jack/varargs.h
@@ -38,22 +39,20 @@ jack_varargs_init (jack_varargs_t *va)
 	va->server_name = jack_default_server_name ();
 }
 
-static inline void
-jack_varargs_parse (jack_options_t options, va_list ap, jack_varargs_t *va)
-{
-	/* initialize default settings */
-	jack_varargs_init (va);
-
-	if ((options & JackServerName)) {
-		char *sn = va_arg(ap, char *);
-		if (sn)
-			va->server_name = sn;
-	}
-	if ((options & JackLoadName))
-		va->load_name = va_arg(ap, char *);
-	if ((options & JackLoadInit))
-		va->load_init = va_arg(ap, char *);
-}
+#define jack_varargs_parse(__options, __ap, __va) do {		\
+	/* initialize default settings */			\
+	jack_varargs_init (__va);				\
+								\
+	if ((__options & JackServerName)) {			\
+		char *sn = va_arg(__ap, char *);		\
+		if (sn)						\
+			(__va)->server_name = sn;		\
+	}							\
+	if ((__options & JackLoadName))				\
+		(__va)->load_name = va_arg(__ap, char *);	\
+	if ((__options & JackLoadInit))				\
+		(__va)->load_init = va_arg(__ap, char *);	\
+} while (0)
 
 #ifdef __cplusplus
 }
--- a/libjack/client.c
+++ b/libjack/client.c
@@ -1117,7 +1117,7 @@ jack_client_new (const char *client_name
 	jack_options_t options = JackUseExactName;
 	if (getenv("JACK_START_SERVER") == NULL)
 		options |= JackNoStartServer;
-	return jack_client_open_aux (client_name, options, NULL, NULL);
+	return jack_client_open(client_name, options, NULL);
 }
 
 char *



Reply to: