Skip to content

Error while build with specific options #819

@oldnick85

Description

@oldnick85

Observed behavior

Build with
NATS_BUILD_WITH_TLS=OFF
NATS_BUILD_STREAMING=OFF
NATS_BUILD_USE_SODIUM=OFF
leads to:

src/glib/glib.c:111:56: error: expected expression before ‘natsLib’
111 | const unsigned int offset = (unsigned int)offsetof(natsLib, refs);

This error occurs due to the absence #include <stddef.h> in glib.c:

src/glib/glib.c:18:1: note: ‘offsetof’ is defined in header ‘<stddef.h>’; did you forget to ‘#include <stddef.h>’?
17 | #include "../crypto.h"
+++ |+#include <stddef.h>
18 |

Expected behavior

Expected successful build

Server and client version

Error detected here: adb9074

Host environment

Ubuntu 24.04.1 LTS
AMD Ryzen™ 9 7900 × 24
gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0
cmake version 3.28.3

Steps to reproduce

mkdir build; cd build
cmake -DNATS_BUILD_WITH_TLS=OFF -DNATS_BUILD_STREAMING=OFF -DNATS_BUILD_USE_SODIUM=OFF -DCMAKE_BUILD_TYPE=Release ..
cmake --build .

Metadata

Metadata

Assignees

Labels

defectSuspected defect such as a bug or regression

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions