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

Error while build with specific options #819

Closed
oldnick85 opened this issue Nov 19, 2024 · 0 comments
Closed

Error while build with specific options #819

oldnick85 opened this issue Nov 19, 2024 · 0 comments
Assignees
Labels
defect Suspected defect such as a bug or regression

Comments

@oldnick85
Copy link
Contributor

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 .

@oldnick85 oldnick85 added the defect Suspected defect such as a bug or regression label Nov 19, 2024
oldnick85 pushed a commit to oldnick85/nats.c that referenced this issue Nov 19, 2024
add stddef include to fix error build with NATS_BUILD_WITH_TLS=OFF NATS_BUILD_STREAMING=OFF NATS_BUILD_USE_SODIUM=OFF
@levb levb self-assigned this Dec 3, 2024
levb pushed a commit that referenced this issue Dec 3, 2024
add stddef include to fix error build with NATS_BUILD_WITH_TLS=OFF NATS_BUILD_STREAMING=OFF NATS_BUILD_USE_SODIUM=OFF

Co-authored-by: oldnick85 <nikitatapin0023@gmail.com>
levb pushed a commit to levb/nats.c that referenced this issue Dec 9, 2024
add stddef include to fix error build with NATS_BUILD_WITH_TLS=OFF NATS_BUILD_STREAMING=OFF NATS_BUILD_USE_SODIUM=OFF

Co-authored-by: oldnick85 <nikitatapin0023@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Suspected defect such as a bug or regression
Projects
None yet
Development

No branches or pull requests

2 participants