Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@gabrielssanches
Copy link

gcc 13.3.0 spits out errors regaring timespec:

nbnet/examples/raylib/server.c:404:16: error: variable ‘t’ has initializer but incomplete type
  404 |         struct timespec t = {.tv_sec = nanos / 999999999, .tv_nsec = nanos % 999999999};
      |                ^~~~~~~~

c99 includes time.h but timespec is not added automatically

changing the C standar from c99 to gnu99 fix this issue

@gabrielssanches
Copy link
Author

or add -DCMAKE_C_FLAGS="-D_GNU_SOURCE" to cmake (then patch the readme file instead), you decide

@nathhB
Copy link
Owner

nathhB commented Sep 23, 2025

@gabrielssanches thank you. I don't think we should change the C standard as nbnet is intended to be a C99 library.

gcc 13.3.0 spits out errors regaring timespec:

```
nbnet/examples/raylib/server.c:404:16: error: variable ‘t’ has initializer but incomplete type
  404 |         struct timespec t = {.tv_sec = nanos / 999999999, .tv_nsec = nanos % 999999999};
      |                ^~~~~~~~
```

c99 includes time.h but timespec is not added automatically

Signed-off-by: Gabriel dos Santos Sanches <[email protected]>
compilation breaks (gcc 13.3.0 in Ubuntu 24) due to missing header
inclusion:

```
nbnet/examples/raylib/server.c:303:5: warning: implicit declaration of function ‘signal’; did you mean ‘sinhl’? [-Wimplicit-function-declaration]
  303 |     signal(SIGINT, SigintHandler);
      |     ^~~~~~
      |     sinhl
nbnet/examples/raylib/server.c:303:12: error: ‘SIGINT’ undeclared (first use in this function)
  303 |     signal(SIGINT, SigintHandler);
      |            ^~~~~~

```

Signed-off-by: Gabriel dos Santos Sanches <[email protected]>
@gabrielssanches gabrielssanches changed the title examples/raylib: changes C standard to gnu99 examples/raylib: fix build in Ubuntu Linux 24 (GCC 13.3.0) Sep 24, 2025
@gabrielssanches
Copy link
Author

changes made

@nathhB
Copy link
Owner

nathhB commented Oct 2, 2025

@gabrielssanches thank you. Looks like some pipeline jobs are failing, but it seems to be due to CMake and Python deprecation. I'll fix those in master and rerun the pipeline in this MR and merge whell they all pass.

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

Successfully merging this pull request may close these issues.

2 participants