[SERVER-35834] Fix compile errors in `dns_name_test` on Microsoft compilers Created: 26/Jun/18  Updated: 29/Oct/23  Resolved: 28/Jun/18

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 3.6.6, 4.0.1, 4.1.1

Type: Bug Priority: Major - P3
Reporter: ADAM Martin (Inactive) Assignee: ADAM Martin (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.0, v3.6
Sprint: Platforms 2018-07-02
Participants:
Linked BF Score: 67

 Description   

It seems that MSVC has some trouble with try blocks that are not within scoped braces (both function-level and within loops too).



 Comments   
Comment by Githook User [ 28/Jun/18 ]

Author:

{'username': 'adamlsd', 'name': 'ADAM David Alan Martin', 'email': 'adam.martin@10gen.com'}

Message: SERVER-35834 Fix compile of test on windows.

Microsoft's compiler has trouble with non-enclosed try-blocks,
even when not function-level try blocks. Also silenced some
type-mismatch warnings on high warning levels.

(cherry picked from commit c467afb7b0c2c3c8f1f12ddcff01400466a53fed)
Branch: v4.0
https://github.com/mongodb/mongo/commit/a06951d124b5ac1c5d2caa3867279372b55311a6

Comment by Githook User [ 28/Jun/18 ]

Author:

{'username': 'adamlsd', 'name': 'ADAM David Alan Martin', 'email': 'adam.martin@10gen.com'}

Message: SERVER-35834 Fix compile of test on windows.

Microsoft's compiler has trouble with non-enclosed try-blocks,
even when not function-level try blocks. Also silenced some
type-mismatch warnings on high warning levels.

(cherry picked from commit c467afb7b0c2c3c8f1f12ddcff01400466a53fed)
Branch: v3.6
https://github.com/mongodb/mongo/commit/d2586cb8ffab072a9e571121ecb9fff994d91063

Comment by Githook User [ 28/Jun/18 ]

Author:

{'username': 'adamlsd', 'name': 'ADAM David Alan Martin', 'email': 'adam.martin@10gen.com'}

Message: SERVER-35834 Fix compile of test on windows.

Microsoft's compiler has trouble with non-enclosed try-blocks,
even when not function-level try blocks. Also silenced some
type-mismatch warnings on high warning levels.
Branch: master
https://github.com/mongodb/mongo/commit/c467afb7b0c2c3c8f1f12ddcff01400466a53fed

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