[MONGOCRYPT-237] "missing braces around initializer" warning when compiling mongocrypt-traverse-util.c Created: 24/Jan/20  Updated: 14/Feb/22  Resolved: 13/May/20

Status: Closed
Project: Libmongocrypt
Component/s: None
Affects Version/s: 1.0.1
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Jeremy Mikola Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0


Issue Links:
Duplicate
duplicates MONGOCRYPT-255 Add missing braces around struct init... Closed

 Description   

I noticed two build warnings when compiling libmongocrypt with PHPC. This may be the result of our aggressive build flags being applied to libmongocrypt sources, which andreas.braun may want to address separately.

I still wanted to open a ticket just in case this is something that should be fixed in libmongocrypt.

src/libmongocrypt/src/mongocrypt-traverse-util.c: In function ‘_mongocrypt_transform_binary_in_bson’:
src/libmongocrypt/src/mongocrypt-traverse-util.c:172:38: warning: missing braces around initializer [-Wmissing-braces]
    _recurse_state_t starting_state = {ctx,
                                      ^
src/libmongocrypt/src/mongocrypt-traverse-util.c:180:39:
                                       0};
                                       {}
src/libmongocrypt/src/mongocrypt-traverse-util.c: In function ‘_mongocrypt_traverse_binary_in_bson’:
src/libmongocrypt/src/mongocrypt-traverse-util.c:205:38: warning: missing braces around initializer [-Wmissing-braces]
    _recurse_state_t starting_state = {ctx,
                                      ^
src/libmongocrypt/src/mongocrypt-traverse-util.c:213:39:
                                       0};
                                       {}



 Comments   
Comment by Jeremy Mikola [ 13/May/20 ]

I forgot about this issue when I reported and fixed MONGOCRYPT-255.

Generated at Thu Feb 08 09:08:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.