[Jack-Devel] compile error

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Jack-Devel] compile error

Pieter Palmers
to avoid:

make[3]: Entering directory
`/home/ppalmers/programming/jack/jack-1/debug/drivers/dummy'
if /bin/sh ../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I.
-I/home/ppalmers/programming/jack/jack-1/drivers/dummy -I../..    
-I/home/ppalmers/programming/jack/jack-1/config
-I/home/ppalmers/programming/jack/jack-1
-I/home/ppalmers/programming/jack/jack-1 -D_REENTRANT
-D_POSIX_PTHREAD_SEMANTICS -Wall -g -O0 -g3
-I/home/ppalmers/programming/jack/jack-1/config
-I/home/ppalmers/programming/jack/jack-1
-I/home/ppalmers/programming/jack/jack-1 -D_REENTRANT
-D_POSIX_PTHREAD_SEMANTICS -Wall -g -O0 -g3 -MT dummy_driver.lo -MD -MP
-MF ".deps/dummy_driver.Tpo" -c -o dummy_driver.lo
/home/ppalmers/programming/jack/jack-1/drivers/dummy/dummy_driver.c; \
        then mv -f ".deps/dummy_driver.Tpo" ".deps/dummy_driver.Plo";
else rm -f ".deps/dummy_driver.Tpo"; exit 1; fi
 gcc -DHAVE_CONFIG_H -I.
-I/home/ppalmers/programming/jack/jack-1/drivers/dummy -I../..
-I/home/ppalmers/programming/jack/jack-1/config
-I/home/ppalmers/programming/jack/jack-1
-I/home/ppalmers/programming/jack/jack-1 -D_REENTRANT
-D_POSIX_PTHREAD_SEMANTICS -Wall -g -O0 -g3
-I/home/ppalmers/programming/jack/jack-1/config
-I/home/ppalmers/programming/jack/jack-1
-I/home/ppalmers/programming/jack/jack-1 -D_REENTRANT
-D_POSIX_PTHREAD_SEMANTICS -Wall -g -O0 -g3 -MT dummy_driver.lo -MD -MP
-MF .deps/dummy_driver.Tpo -c
/home/ppalmers/programming/jack/jack-1/drivers/dummy/dummy_driver.c  
-fPIC -DPIC -o .libs/dummy_driver.o
/home/ppalmers/programming/jack/jack-1/drivers/dummy/dummy_driver.c: In
function 'FakeVideoSync':
/home/ppalmers/programming/jack/jack-1/drivers/dummy/dummy_driver.c:48:
error: initializer element is not constant
make[3]: *** [dummy_driver.lo] Error 1
make[3]: Leaving directory
`/home/ppalmers/programming/jack/jack-1/debug/drivers/dummy'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory
`/home/ppalmers/programming/jack/jack-1/debug/drivers'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/ppalmers/programming/jack/jack-1/debug'
make: *** [all] Error 2



I had to change:
(drivers/dummy_driver.c)
<<<<<<<<<<<<<<<<<<<

void
FakeVideoSync( dummy_driver_t *driver )
{
        static const int VIDEO_SYNC_PERIOD = 48000 / 30;
        static int vidCounter = VIDEO_SYNC_PERIOD;
       
        int period = driver->period_size;
        jack_position_t *position = &driver->engine->control->current_time;

<<<<<<<<<<<<<<<<<<<

to:

 >>>>>>>>>>>>>>>>>>>
void
FakeVideoSync( dummy_driver_t *driver )
{
        //static const int VIDEO_SYNC_PERIOD = 48000 / 30;
        #define VIDEO_SYNC_PERIOD (48000 / 30)
        static int vidCounter = VIDEO_SYNC_PERIOD;
       
        int period = driver->period_size;
        jack_position_t *position = &driver->engine->control->current_time;

 >>>>>>>>>>>>>>>>>>>


GCC version:
gcc (GCC) 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Is there any reason not to make this a #define?

Pieter
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: [Jack-Devel] compile error

Paul Davis
On Sat, 2007-12-15 at 15:17 +0100, Pieter Palmers wrote:

>
> Is there any reason not to make this a #define?

none. although I am strongly convinced that gcc is in error here.

--p


_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: [Jack-Devel] compile error

Glynn Clements

Paul Davis wrote:

> On Sat, 2007-12-15 at 15:17 +0100, Pieter Palmers wrote:
>
> >
> > Is there any reason not to make this a #define?
>
> none. although I am strongly convinced that gcc is in error here.

It isn't. Variables aren't considered compile-time constants, even if
they have the "const" qualifier.

The "leaf nodes" of an initialiser expression are limited to literals,
enumeration constants and the values returned by the unary "&" and
"sizeof" operators.

Also, in C89 the "const" qualifier can only be applied to arrays or
pointer targets, so "const int foo" isn't valid. In C99, "const" can
be applied to variables or other lvalues, making it an error to modify
them, but it doesn't make them into compile-time constants.

--
Glynn Clements <[hidden email]>
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org