[CDRIVER-2460] BSON_STATIC_ASSERT() definition is broken Created: 10/Jan/18  Updated: 28/Oct/23  Resolved: 10/Jan/18

Status: Closed
Project: C Driver
Component/s: libbson
Affects Version/s: 1.9.1
Fix Version/s: 1.9.2

Type: Bug Priority: Major - P3
Reporter: Petr Pisar Assignee: A. Jesse Jiryu Davis
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File mongo-c-driver-1.9.0-Fix-BSON_STATIC_ASSERT-definition.patch    
Issue Links:
Related
is related to CDRIVER-2450 Altering BSON_STATIC_ASSERT_JOIN2 mac... Closed

 Description   

1.9.1 defines BSON_STATIC_ASSERT() like this:

#define BSON_STATIC_ASSERT(s) BSON_STATIC_ASSERT_ (s, __LINE__, assert)

But BSON_STATIC_ASSERT_() macro takes only two arguments:

#define BSON_STATIC_ASSERT_(s, l)                             \
   typedef char BSON_STATIC_ASSERT_JOIN (static_assert_test_, \
                                         __LINE__)[(s) ? 1 : -1]



 Comments   
Comment by Githook User [ 11/Jan/18 ]

Author:

{'email': 'jesse@mongodb.com', 'name': 'A. Jesse Jiryu Davis', 'username': 'ajdavis'}

Message: CDRIVER-2460 test old BSON_STATIC_ASSERT macro
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/c235cf78c80669a44e5bed54c975936b0aaa22b7

Comment by Githook User [ 10/Jan/18 ]

Author:

{'email': 'ppisar@redhat.com', 'name': 'Petr Písař', 'username': 'ppisar'}

Message: CDRIVER-2460 fix BSON_STATIC_ASSERT definition

The macro definition was mistakenly changed in 1.9.0 (CDRIVER-2271) and partly
reverted (CDRIVER-2450). This change completely reverts the macro to its 1.8.0
definition.

Signed-off-by: Petr Písař <ppisar@redhat.com>
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/35b0a890a50714b74d7793073d4d9e6693f70ad8

Comment by A. Jesse Jiryu Davis [ 10/Jan/18 ]

Thanks Petr. My colleague and I thought we had properly reverted this macro to its 1.8.0 definition but I made a mistake again.

Generated at Wed Feb 07 21:15:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.