Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In Rocky Linux 9.2 got error "unknown type name ‘bool’" #17

Open
rodolfojcj opened this issue Sep 25, 2023 · 2 comments
Open

In Rocky Linux 9.2 got error "unknown type name ‘bool’" #17

rodolfojcj opened this issue Sep 25, 2023 · 2 comments

Comments

@rodolfojcj
Copy link

When using the DAHDI linux complete 3.2.0 tar.gz file or the master branch sources, trying to compile the tools component on Rocky Linux 9.2 fails with error messages like these:

dahdi_cfg.c:148:8: error: unknown type name ‘bool’
  148 | static bool _are_all_spans_assigned(const char *device_path)
      |        ^~~~
dahdi_cfg.c: In function ‘_are_all_spans_assigned’:
dahdi_cfg.c:162:24: error: ‘false’ undeclared (first use in this function)
  162 |                 return false;
      |                        ^~~~~
dahdi_cfg.c:53:1: note: ‘false’ is defined in header ‘<stdbool.h>’; did you forget to ‘#include <stdbool.h>’?
   52 | #include "dahdi_tools_version.h"
  +++ |+#include <stdbool.h>
   53 | 
dahdi_cfg.c:162:24: note: each undeclared identifier is reported only once for each function it appears in
  162 |                 return false;
      |                        ^~~~~
dahdi_cfg.c:182:43: error: ‘true’ undeclared (first use in this function)
  182 |         return (span_count > 0) ? false : true;
      |                                           ^~~~
dahdi_cfg.c:182:43: note: ‘true’ is defined in header ‘<stdbool.h>’; did you forget to ‘#include <stdbool.h>’?
dahdi_cfg.c: At top level:
dahdi_cfg.c:191:8: error: unknown type name ‘bool’
  191 | static bool are_all_spans_assigned(void)
      |        ^~~~
dahdi_cfg.c: In function ‘are_all_spans_assigned’:
dahdi_cfg.c:195:9: error: unknown type name ‘bool’
  195 |         bool res = true;
      |         ^~~~
dahdi_cfg.c:195:9: note: ‘bool’ is defined in header ‘<stdbool.h>’; did you forget to ‘#include <stdbool.h>’?
dahdi_cfg.c:195:20: error: ‘true’ undeclared (first use in this function)
  195 |         bool res = true;
      |                    ^~~~
dahdi_cfg.c:195:20: note: ‘true’ is defined in header ‘<stdbool.h>’; did you forget to ‘#include <stdbool.h>’?
dahdi_cfg.c: At top level:
dahdi_cfg.c:226:8: error: unknown type name ‘bool’
  226 | static bool wait_for_all_spans_assigned(unsigned long timeout_sec)
      |        ^~~~
dahdi_cfg.c: In function ‘wait_for_all_spans_assigned’:
dahdi_cfg.c:228:9: error: unknown type name ‘bool’
  228 |         bool all_assigned = are_all_spans_assigned();
      |         ^~~~
dahdi_cfg.c:228:9: note: ‘bool’ is defined in header ‘<stdbool.h>’; did you forget to ‘#include <stdbool.h>’?
dahdi_cfg.c: In function ‘main’:
dahdi_cfg.c:1596:17: error: unknown type name ‘bool’
 1596 |                 bool all_assigned = wait_for_all_spans_assigned(5);
      |                 ^~~~
dahdi_cfg.c:1596:17: note: ‘bool’ is defined in header ‘<stdbool.h>’; did you forget to ‘#include <stdbool.h>’?
make[3]: *** [Makefile:985: dahdi_cfg.o] Error 1

The running Linux kernel version looks like this:

Linux localhost.localdomain 5.14.0-284.25.1.el9_2.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Aug 2 14:53:30 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
@rodolfojcj
Copy link
Author

The possible cause of the error is the same already detailed in the comment at asterisk/dahdi-linux#36 (comment) for the related dahdi-linux component.

@rodolfojcj
Copy link
Author

The attached file dahdi-tools-issue-17-fix-24sept2023.zip has a possible fix to this issue.

I tested it with:

  • Ubuntu 23.04, kernel 6.2.0-20-generic
  • Ubuntu 22.10, kernel 5.19.0-43-generic
  • Ubuntu 22.04, kernel 5.15.0-73-generic
  • Ubuntu 20.04, kernel 5.4.0-150-generic
  • Ubuntu 18.04, kernel 4.15.0-212-generic
  • Ubuntu 16.04, kernel 4.4.0-210-generic
  • Debian 12, kernel 6.1.0-10-amd64
  • Debian 11, kernel 5.10.0-23-amd64
  • Debian 10, kernel 4.19.0-24-amd64
  • CentOS 7.9.2009 3.10.0-1160.95.1.el7.x86_64
  • Rocky Linux 9.2, kernel 5.14.0-284.25.1.el9_2.x86_64
  • Rocky Linux 8.8, kernel 4.18.0-477.21.1.el8_8.x86_64

In all those cases the compilation is successful.

Thanks in advance for any developer of this project that may review and possibly apply this fix for the master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant