[SERVER-55242] Fix format strings given as char* (xcode build fix) Created: 16/Mar/21  Updated: 29/Oct/23  Resolved: 16/Mar/21

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Bug Priority: Major - P3
Reporter: Billy Donahue Assignee: Billy Donahue
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Service Arch 2021-03-22
Participants:

 Description   

For example:

-            static constexpr auto errorMsg =
+            static constexpr auto& errorMsg =
                 "Failed to complete construction of sharding DDL coordinator";

Without the ampersand, the string literal decays to a pointer.
FMT_STRING can't use pointers. It needs arrays.



 Comments   
Comment by Githook User [ 16/Mar/21 ]

Author:

{'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}

Message: SERVER-55242 format needs char(&)[N], not char*
Branch: master
https://github.com/mongodb/mongo/commit/e649936b7740319f94ef5320167c78543e40c257

Generated at Thu Feb 08 05:35:54 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.