[Asterisk-Users] Asterisk compiling problems...

Paul Hewlett paul at cottonpickinminds.co.za
Fri Apr 7 11:13:00 MST 2006


On Monday 03 April 2006 22:14, George A. Michalopoulos wrote:
> Hello all,
>
> I just got the latest cvs snapshot and I'm trying to compile asterisk..
> When I run nefeli:/usr/src/asterisk/zaptel# make clean; make linux26
> Compile stops with errors...
>
> /usr/src/asterisk/zaptel/zaptel.c:6509: warning: passing argument 2 of
> 'class_device_create' makes pointer from integer without a cast
> /usr/src/asterisk/zaptel/zaptel.c:6509: warning: passing argument 3 of
> 'class_device_create' makes integer from pointer without a cast
> /usr/src/asterisk/zaptel/zaptel.c:6509: warning: passing argument 4 of
> 'class_device_create' from incompatible pointer type
> /usr/src/asterisk/zaptel/zaptel.c:6509: error: too few arguments to
> function 'class_device_create'
> /usr/src/asterisk/zaptel/zaptel.c:6510: warning: passing argument 2 of
> 'class_device_create' makes pointer from integer without a cast
> /usr/src/asterisk/zaptel/zaptel.c:6510: warning: passing argument 3 of
> 'class_device_create' makes integer from pointer without a cast
> /usr/src/asterisk/zaptel/zaptel.c:6510: warning: passing argument 4 of
> 'class_device_create' from incompatible pointer type
> /usr/src/asterisk/zaptel/zaptel.c:6510: error: too few arguments to
> function 'class_device_create'
> make[2]: *** [/usr/src/asterisk/zaptel/zaptel.o] Error 1
> make[1]: *** [_module_/usr/src/asterisk/zaptel] Error 2
> make[1]: Leaving directory `/usr/src/linux-2.6.15.6'
> make: *** [linux26] Error 2
>


I had a similar problem with the sirrix drivers.

The new gcc compiler treats as an error if one specifies a normal string when 
a format string (in the style of printf) is expected. This warning is 
triggered by the __attribute printf (I forget the exact syntax)  for the 
prototype in the appropriate header file.

This error is fixed by inserting an extra argument "%s" where the format 
string is expected e.g.

    function proto is 

                    int myprintf( int fd, char *fmt, ...)

    and it is being called by

                    myprintf( fd,"Some string")

    which generates the warning. Fix by changing to

                    myprintf (fd, "%s", "Some string")

Paul



More information about the asterisk-users mailing list