[asterisk-dev] bug 8501 [was: compilation problems with linux 2.6.19]

Paul Hewlett paul at gccs.co.za
Tue Dec 5 00:21:33 MST 2006


On Monday 04 December 2006 18:32, Tzafrir Cohen wrote:
> Hi
>
> I'd appreciate a "second opinion" regarding
> http://bugs.digium.com/view.php?id=8501 .
>
> I'm obviously missing something there

Tzafrir

I don't if this will help but the standard way of defining bool is using the 
following

#ifdef STDBOOL
#include <stdbool.h>
#else
/* An interim version of <stdbool.h> from C/C++ Users Journal
 * May 2002. These lines are compatible with C90,C++ and C99
 * standards                                                 */
#   ifndef  __cplusplus /*OK*/
#      ifndef __bool_true_false_are_defined
#         define __bool_true_false_are_defined 1
/* if this is C99 or later use builtin tool */
#         if __STDC_VERSION__ >= 199901L
#            define bool _Bool
#         else
/* Choose an unsigned type that can be used as a bitfield OK */
#            define bool unsigned char /*OK*/
#         endif
#      endif
#      define true  1
#      define false 0
#   endif

#endif


Paul 

>
> ----- Forwarded message from Tzafrir Cohen <tzafrir.cohen at xorcom.com> -----
>
> Envelope-to: tzafrir.cohen at xorcom.com
> Delivery-date: Thu, 30 Nov 2006 14:52:54 -0500
> Date: Thu, 30 Nov 2006 21:49:33 +0200
> From: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
> To: Asterisk Users Mailing List - Non-Commercial Discussion
> <asterisk-users at lists.digium.com> Subject: Re: [asterisk-users] zaptel
> compilation problems with linux 2.6.19 Mail-Followup-To: Asterisk Users
> Mailing List - Non-Commercial Discussion <asterisk-users at lists.digium.com>
> Organization: Xorcom*
> Reply-To: Asterisk Users Mailing List - Non-Commercial Discussion
> <asterisk-users at lists.digium.com>
>
> On Thu, Nov 30, 2006 at 07:19:14PM +0200, Roman Yeryomin wrote:
> > Hello!
> >
> > I have problems compiling zaptel (tried 1.2.11, 1.2.10 and 1.4.0-beta2 --
> > all give the same error) with 2.6.19 kernel
> >
> >   CC [M]  /home/roman/install/asterisk/zaptel-1.4.0-beta2/xpp/card_fxo.o
> > In file included
> > from /home/roman/install/asterisk/zaptel-1.4.0-beta2/xpp/xpd.h:26,
> > from /home/roman/install/asterisk/zaptel-1.4.0-beta2/xpp/card_fxo.c:28:
> > /home/roman/install/asterisk/zaptel-1.4.0-beta2/xpp/xdefs.h:93: error:
> > conflicting types for 'bool'
> > include/linux/types.h:36: error: previous declaration of 'bool' was here
> > In file included
> > from /home/roman/install/asterisk/zaptel-1.4.0-beta2/zconfig.h:9,
> > from /home/roman/install/asterisk/zaptel-1.4.0-beta2/zaptel.h:34,
> > from /home/roman/install/asterisk/zaptel-1.4.0-beta2/xpp/xproto.h:29,
> > from /home/roman/install/asterisk/zaptel-1.4.0-beta2/xpp/xpd.h:27,
> > from /home/roman/install/asterisk/zaptel-1.4.0-beta2/xpp/card_fxo.c:28:
> > include/linux/config.h:10:3: warning: no newline at end of file
> > make[3]: ***
> > [/home/roman/install/asterisk/zaptel-1.4.0-beta2/xpp/card_fxo.o] Error 1
> > make[2]: *** [/home/roman/install/asterisk/zaptel-1.4.0-beta2/xpp] Error
> > 2 make[1]: *** [_module_/home/roman/install/asterisk/zaptel-1.4.0-beta2]
> > Error 2 make[1]: Leaving directory
> > `/home/roman/install/kernel/linux-2.6.19' make: *** [linux26] Error 2
> >
> > seems that commenting out "typedef int bool;" in xpp/xdefs.h on line 93
> > works that out, but don't know if it's completely right thing to do
>
> Simply replacing that int with a _Bool will give several "incompatible
> pointer type" warnings. The following is from our internal working copy,
> with pathes removed for clarity:
>
>   CC [M]  xpp/card_fxo.o
> xpp/card_fxo.c: In function `__check_report_battery':
> xpp/card_fxo.c:38: warning: return from incompatible pointer type
>   CC [M]  xpp/card_fxs.o
> xpp/card_fxs.c: In function `__check_poll_digital_inputs':
> xpp/card_fxs.c:37: warning: return from incompatible pointer type
>   CC [M]  xpp/xbus-core.o
>   CC [M]  xpp/xpp_zap.o
> xpp/xpp_zap.c: In function `__check_zap_autoreg':
> xpp/xpp_zap.c:67: warning: return from incompatible pointer type
> xpp/xpp_zap.c: In function `__check_prefmaster':
> xpp/xpp_zap.c:68: warning: return from incompatible pointer type
> xpp/xpp_zap.c: In function `__check_xpp_ec':
> xpp/xpp_zap.c:70: warning: return from incompatible pointer type
> xpp/xpp_zap.c: In function `xpd_read_proc':
> xpp/xpp_zap.c:437: warning: unused variable `chans'
> xpp/xpp_zap.c: In function `proc_sync_write':
> xpp/xpp_zap.c:748: warning: int format, bool arg (arg 5)
> xpp/xpp_zap.c: In function `proc_xpd_ztregister_write':
> xpp/xpp_zap.c:816: warning: int format, bool arg (arg 3)
>
> Most of them seem to be related to the procfs interface. If you don't
> need xpp for yourself and can leave with those warnings, go ahead.
>
> I'll try to resolve them.
>
> ----- End forwarded message -----

-- 
Paul Hewlett  Technical Director 
Global Call Center Solutions Ltd, 2nd Floor, Milnerton Mall
Cnr Loxton & Koeberg Roads, 7435 Milnerton
paul at gccs.co.za  www.gccs.co.za
Tel: +27 86 111 3433 Fax: +27 86 111 3520 Cel: +27 84 420 9282
Gizmo: 1 747 659 6171



More information about the asterisk-dev mailing list