Skip to content
This repository was archived by the owner on Oct 13, 2020. It is now read-only.

Commit b908d31

Browse files
committed
CDRIVER-2374 fix C99 pedantic warning
1 parent 3a3b1d7 commit b908d31

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

.evergreen/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ tasks:
390390
type: test
391391
params:
392392
working_dir: "libbson"
393-
script: "CC='${CC}' MARCH='${MARCH}' CFLAGS='-std=c99 -D_XOPEN_SOURCE=600' RELEASE=1 sh .evergreen/compile.sh"
393+
script: "CC='${CC}' MARCH='${MARCH}' CFLAGS='-std=c99 -D_XOPEN_SOURCE=600 -pedantic' RELEASE=1 sh .evergreen/compile.sh"
394394

395395
- name: release-compile-c89
396396
depends_on:

src/bson/bson-context-private.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ BSON_BEGIN_DECLS
2727

2828

2929
struct _bson_context_t {
30-
bson_context_flags_t flags : 7;
30+
/* flags are defined in bson_context_flags_t */
31+
int flags : 7;
3132
bool pidbe_once : 1;
3233
uint8_t pidbe[2];
3334
uint8_t md5[3];

src/bson/bson-context.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ _bson_context_init (bson_context_t *context, /* IN */
327327
unsigned int real_seed;
328328
bson_oid_t oid;
329329

330-
context->flags = flags;
330+
context->flags = (int) flags;
331331
context->oid_get_host = _bson_context_get_oid_host_cached;
332332
context->oid_get_pid = _bson_context_get_oid_pid_cached;
333333
context->oid_get_seq32 = _bson_context_get_oid_seq32;

tests/test-oid.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ test_bson_oid_init_with_threads (void)
293293
int i;
294294

295295
{
296-
bson_context_flags_t flags = 0;
296+
bson_context_flags_t flags = BSON_CONTEXT_NONE;
297297
bson_context_t *contexts[N_THREADS];
298298
bson_thread_t threads[N_THREADS];
299299

0 commit comments

Comments
 (0)