Public bug reported:

[ Impact ]

 * fix build failure due to bool being used as variable name, which
became a keyword in c23.

[ Test Plan ]

 * observe the build failure: build nss-pam-ldapd_0.9.13-1 on questing
 * with the fix, the build succeeds.

[ Where problems could occur ]

 * no functional change is introduced, so this should be rather safe
 * the rebuild could pick up new compiler bugs

[ Original error ]

gcc -DHAVE_CONFIG_H -I. -I..  -I.. -Wdate-time -D_FORTIFY_SOURCE=3  -g -O2 
-Werror=implicit-function-declaration -fno-omit-frame-pointer 
-mno-omit-leaf-frame-pointer 
-ffile-prefix-map=/home/ubuntu/nss-pam-ldapd-0.9.13=. -flto=auto 
-ffat-lto-objects -fstack-protector-strong -fstack-clash-protection -Wformat 
-Werror=for
mat-security -fcf-protection 
-fdebug-prefix-map=/home/ubuntu/nss-pam-ldapd-0.9.13=/usr/src/nss-pam-ldapd-0.9.13-1
 -pedantic -Wall -Wshadow -Wpointer-arith -Wcast-align -Wstrict-prototypes 
-Wmissing-prototypes -Wnested-externs -Waggregate-return -Wmissing-declarations 
-Wunused -Wformat=2 -Wswitch-default -Wswitch-enum
-Wfloat-equal -Wbad-function-cast -Wredundant-decls -Wextra 
-Wdeclaration-after-statement -Werror-implicit-function-declaration 
-Werror=implicit -c -o cfg.o cfg.c

cfg.c:210:38: error: ‘bool’ cannot be used here
  210 | static const char *print_boolean(int bool)
      |                                      ^~~~
cfg.c:210:38: note: ‘bool’ is a keyword with ‘-std=c23’ onwards
cfg.c: In function ‘print_boolean’:
cfg.c:212:7: warning: ISO C does not support if declarations before C2Y 
[-Wpedantic]
  212 |   if (bool) return "yes";
      |       ^~~~
cfg.c:212:11: error: expected identifier or ‘(’ before ‘)’ token
  212 |   if (bool) return "yes";
      |           ^
cfg.c:212:7: error: declaration in the controlling expression must have an 
initializer
  212 |   if (bool) return "yes";
      |       ^~~~
cfg.c:214:1: warning: control reaches end of non-void function [-Wreturn-type]
  214 | }
      | ^

** Affects: nss-pam-ldapd (Ubuntu)
     Importance: Undecided
     Assignee: Jonas Jelten (jj)
         Status: In Progress


** Tags: ftbfs questing

** Changed in: nss-pam-ldapd (Ubuntu)
     Assignee: (unassigned) => Jonas Jelten (jj)

** Description changed:

+ [ Impact ]
+ 
+  * fix build failure due to bool being used as variable name, which
+ became a keyword in c23.
+ 
+ [ Test Plan ]
+ 
+  * observe the build failure: build nss-pam-ldapd_0.9.13-1 on questing
+  * with the fix, the build succeeds.
+ 
+ [ Where problems could occur ]
+ 
+  * no functional change is introduced, so this should be rather safe
+  * the rebuild could pick up new compiler bugs
+ 
+ [ Original error ]
+ 
  gcc -DHAVE_CONFIG_H -I. -I..  -I.. -Wdate-time -D_FORTIFY_SOURCE=3  -g -O2 
-Werror=implicit-function-declaration -fno-omit-frame-pointer 
-mno-omit-leaf-frame-pointer 
-ffile-prefix-map=/home/ubuntu/nss-pam-ldapd-0.9.13=. -flto=auto 
-ffat-lto-objects -fstack-protector-strong -fstack-clash-protection -Wformat 
-Werror=for
- mat-security -fcf-protection 
-fdebug-prefix-map=/home/ubuntu/nss-pam-ldapd-0.9.13=/usr/src/nss-pam-ldapd-0.9.13-1
 -pedantic -Wall -Wshadow -Wpointer-arith -Wcast-align -Wstrict-prototypes 
-Wmissing-prototypes -Wnested-externs -Waggregate-return -Wmissing-declarations 
-Wunused -Wformat=2 -Wswitch-default -Wswitch-enum 
+ mat-security -fcf-protection 
-fdebug-prefix-map=/home/ubuntu/nss-pam-ldapd-0.9.13=/usr/src/nss-pam-ldapd-0.9.13-1
 -pedantic -Wall -Wshadow -Wpointer-arith -Wcast-align -Wstrict-prototypes 
-Wmissing-prototypes -Wnested-externs -Waggregate-return -Wmissing-declarations 
-Wunused -Wformat=2 -Wswitch-default -Wswitch-enum
  -Wfloat-equal -Wbad-function-cast -Wredundant-decls -Wextra 
-Wdeclaration-after-statement -Werror-implicit-function-declaration 
-Werror=implicit -c -o cfg.o cfg.c
  
  cfg.c:210:38: error: ‘bool’ cannot be used here
-   210 | static const char *print_boolean(int bool)
-       |                                      ^~~~
+   210 | static const char *print_boolean(int bool)
+       |                                      ^~~~
  cfg.c:210:38: note: ‘bool’ is a keyword with ‘-std=c23’ onwards
  cfg.c: In function ‘print_boolean’:
  cfg.c:212:7: warning: ISO C does not support if declarations before C2Y 
[-Wpedantic]
-   212 |   if (bool) return "yes";
-       |       ^~~~
+   212 |   if (bool) return "yes";
+       |       ^~~~
  cfg.c:212:11: error: expected identifier or ‘(’ before ‘)’ token
-   212 |   if (bool) return "yes";
-       |           ^
+   212 |   if (bool) return "yes";
+       |           ^
  cfg.c:212:7: error: declaration in the controlling expression must have an 
initializer
-   212 |   if (bool) return "yes";
-       |       ^~~~
+   212 |   if (bool) return "yes";
+       |       ^~~~
  cfg.c:214:1: warning: control reaches end of non-void function [-Wreturn-type]
-   214 | }
-       | ^
+   214 | }
+       | ^

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2139290

Title:
  ftbfs on questing due to c23 bool keyword

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/nss-pam-ldapd/+bug/2139290/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to