Zaptel
  1. Zaptel
  2. ZAP-333

[patch] RHEL/Centos 5.2: xpp/xdefs.h:117: error: conflicting types for ‘bool’

    Details

    • Type: Bug Bug
    • Status: Closed
    • Severity: Major Major
    • Resolution: Fixed
    • Component/s: Astribank (xpp)
    • Labels:
      None
    • SVN Revision Number:
      4353
    • Mantis ID:
      12889
    • Regression:
      No

      Description

      The kernel included in RHEL 5.2 and thus also in Centos 5.2 backported a feature from kernel 2.6.19: the type "bool".

      The xpp driver used a "bool" type of its own even before definition. Hence it only adds that typedef for kernel versions that should not have it already:

      kernel/xpp/xdefs.h:

      #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
      typedef int bool;
      #endif

      Thus we get the following error:

      CC [M] /usr/src/zaptel-1.4.11/kernel/xpp/card_fxo.o
      In file included from /usr/src/zaptel-1.4.11/kernel/xpp/xpd.h:26,
      from /usr/src/zaptel-1.4.11/kernel/xpp/card_fxo.c:27:
      /usr/src/zaptel-1.4.11/kernel/xpp/xdefs.h:117: error: conflicting types
      for ‘bool’
      include/linux/types.h:36: error: previous declaration of ‘bool’ was here
      make[4]: *** [/usr/src/zaptel-1.4.11/kernel/xpp/card_fxo.o] Error 1
      make[3]: *** [/usr/src/zaptel-1.4.11/kernel/xpp] Error 2
      make[2]: *** [_module_/usr/src/zaptel-1.4.11/kernel] Error 2
      make[2]: Leaving directory `/usr/src/kernels/2.6.18-92.1.1.el5-x86_64'
      make[1]: *** [modules] Error 2
      make[1]: Leaving directory `/usr/src/zaptel-1.4.11'
      make: *** [all] Error 2

      Simple workaround for that specific case: avoid that typedef:
      } while(0);

      #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
      -typedef int bool;
      +//typedef int bool;
      #endif
      #else
      typedef int bool;

        Activity

        Hide
        Tzafrir Cohen added a comment -

        Uploaded a potential fix. hex_asc() is a macro that hapened to be added in the same patch in which the typedef of bool was backported into the RHEL 5.2 kernel package. Thus it is a good marker for that typedef.

        (Hopefully)

        Show
        Tzafrir Cohen added a comment - Uploaded a potential fix. hex_asc() is a macro that hapened to be added in the same patch in which the typedef of bool was backported into the RHEL 5.2 kernel package. Thus it is a good marker for that typedef. (Hopefully)
        Hide
        SIP:ian@txrx.ca added a comment -

        That patch solved the compile problem for me. Thanks.

        Show
        SIP:ian@txrx.ca added a comment - That patch solved the compile problem for me. Thanks.
        Hide
        Digium Subversion added a comment -

        Repository: zaptel
        Revision: 4367

        U branches/1.2/xpp/xdefs.h

        ------------------------------------------------------------------------
        r4367 | tzafrir | 2008-06-28 02:17:26 -0500 (Sat, 28 Jun 2008) | 2 lines

        Fixes building with the kernel of RHEL 5.2. Closes issue ZAP-333 .

        ------------------------------------------------------------------------

        http://svn.digium.com/view/zaptel?view=rev&revision=4367

        Show
        Digium Subversion added a comment - Repository: zaptel Revision: 4367 U branches/1.2/xpp/xdefs.h ------------------------------------------------------------------------ r4367 | tzafrir | 2008-06-28 02:17:26 -0500 (Sat, 28 Jun 2008) | 2 lines Fixes building with the kernel of RHEL 5.2. Closes issue ZAP-333 . ------------------------------------------------------------------------ http://svn.digium.com/view/zaptel?view=rev&revision=4367
        Hide
        Digium Subversion added a comment -

        Repository: dahdi
        Revision: 4467

        U linux/trunk/drivers/dahdi/xpp/xdefs.h

        ------------------------------------------------------------------------
        r4467 | tzafrir | 2008-06-28 03:04:39 -0500 (Sat, 28 Jun 2008) | 2 lines

        Fixes building with kernel of RHEl 5.2. Closes issue ZAP-333 .

        ------------------------------------------------------------------------

        http://svn.digium.com/view/dahdi?view=rev&revision=4467

        Show
        Digium Subversion added a comment - Repository: dahdi Revision: 4467 U linux/trunk/drivers/dahdi/xpp/xdefs.h ------------------------------------------------------------------------ r4467 | tzafrir | 2008-06-28 03:04:39 -0500 (Sat, 28 Jun 2008) | 2 lines Fixes building with kernel of RHEl 5.2. Closes issue ZAP-333 . ------------------------------------------------------------------------ http://svn.digium.com/view/dahdi?view=rev&revision=4467

          People

          • Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development