You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Ian Emmons <ia...@emmons.mobi> on 2026/03/16 19:32:24 UTC

[daemon] jsvc build fails under GCC 15.2.0

I am attempting to build jsvc under Ubuntu 25.10 using the default system compiler, GCC 15.2.0. The build fails with the following error:

In file included from jsvc-unix.c:17:

jsvc.h:32:5: error: cannot use keyword ‘false’ as enumeration constant

   32 |     false,

      |     ^~~~~

jsvc.h:32:5: note: ‘false’ is a keyword with ‘-std=c23’ onwards

jsvc.h:34:3: error: expected ‘;’, identifier or ‘(’ before ‘bool’

   34 | } bool;

      |   ^~~~

jsvc.h:34:3: warning: useless type name in empty declaration


This stems from these lines near to top of jsvc.h:

#ifdef OS_DARWIN

#include <stdbool.h>

#else

typedef enum {

    false,

    true

} bool;

#endif


I believe that the line "#ifdef OS_DARWIN" should be replaced by something like this:

#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */


so that stdbool.h is included for all C99-conforming compilers, not just Apple's clang.


Thanks,



Ian

Re: [daemon] jsvc build fails under GCC 15.2.0

Posted by Gary Gregory <ga...@gmail.com>.
Hi Ian,

Did you follow the instructions in
https://github.com/apache/commons-daemon/blob/master/src/native/unix/INSTALL.txt
?

Gary

On Mon, Mar 16, 2026, 15:32 Ian Emmons <ia...@emmons.mobi> wrote:

> I am attempting to build jsvc under Ubuntu 25.10 using the default system
> compiler, GCC 15.2.0. The build fails with the following error:
>
> In file included from jsvc-unix.c:17:
>
> jsvc.h:32:5: error: cannot use keyword ‘false’ as enumeration constant
>
>    32 |     false,
>
>       |     ^~~~~
>
> jsvc.h:32:5: note: ‘false’ is a keyword with ‘-std=c23’ onwards
>
> jsvc.h:34:3: error: expected ‘;’, identifier or ‘(’ before ‘bool’
>
>    34 | } bool;
>
>       |   ^~~~
>
> jsvc.h:34:3: warning: useless type name in empty declaration
>
>
> This stems from these lines near to top of jsvc.h:
>
> #ifdef OS_DARWIN
>
> #include <stdbool.h>
>
> #else
>
> typedef enum {
>
>     false,
>
>     true
>
> } bool;
>
> #endif
>
>
> I believe that the line "#ifdef OS_DARWIN" should be replaced by something
> like this:
>
> #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */
>
>
> so that stdbool.h is included for all C99-conforming compilers, not just
> Apple's clang.
>
>
> Thanks,
>
>
>
> Ian