Skip to content

Commit b5e306f

Browse files
authored
Enable /permissive- on MSVC for better standards conformance (#2251)
* Enable /permissive- on MSVC for better C++ conformance and fix related errors * Clean up left over warning suppressions from old library or msvc versions
1 parent 31774e8 commit b5e306f

36 files changed

+41
-195
lines changed

indra/cmake/00-Common.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ if (WINDOWS)
8383
/Oy-
8484
/fp:fast
8585
/MP
86+
/permissive-
8687
)
8788

8889
# Nicky: x64 implies SSE2

indra/llappearance/llavatarappearancedefines.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ LLAvatarAppearanceDictionary::BakedEntry::BakedEntry(ETextureIndex tex_index,
252252
LLWearableType::EType t = (LLWearableType::EType)va_arg(argp,int);
253253
mWearables.push_back(t);
254254
}
255+
va_end(argp);
255256
}
256257

257258
ETextureIndex LLAvatarAppearanceDictionary::bakedToLocalTextureIndex(EBakedTextureIndex index) const

indra/llcommon/llallocator_heap_profile.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,6 @@
2828
#include "linden_common.h"
2929
#include "llallocator_heap_profile.h"
3030

31-
#if LL_MSVC
32-
// disable warning about boost::lexical_cast returning uninitialized data
33-
// when it fails to parse the string
34-
#pragma warning (disable:4701)
35-
#pragma warning (disable:4702)
36-
#endif
37-
3831
#include <boost/algorithm/string/split.hpp>
3932
#include <boost/bind.hpp>
4033
#include <boost/lexical_cast.hpp>

indra/llcommon/llevents.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,8 @@
3838
#include <vector>
3939
#include <deque>
4040
#include <functional>
41-
#if LL_WINDOWS
42-
#pragma warning (push)
43-
#pragma warning (disable : 4263) // boost::signals2::expired_slot::what() has const mismatch
44-
#pragma warning (disable : 4264)
45-
#endif
46-
#include <boost/signals2.hpp>
47-
#if LL_WINDOWS
48-
#pragma warning (pop)
49-
#endif
5041

42+
#include <boost/signals2.hpp>
5143
#include <boost/bind.hpp>
5244
#include <boost/utility.hpp> // noncopyable
5345
#include <boost/optional/optional.hpp>

indra/llcommon/llfindlocale.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ canonise_fl(FL_Locale *l) {
185185
#define RML(pn,sn) MAKELANGID(LANG_##pn, SUBLANG_##sn)
186186
struct IDToCode {
187187
LANGID id;
188-
char* code;
188+
const char* code;
189189
};
190190
static const IDToCode both_to_code[] = {
191191
{ML(ENGLISH,US), "en_US.ISO_8859-1"},

indra/llcommon/llsdjson.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,7 @@
3535
#include "llerror.h"
3636
#include "../llmath/llmath.h"
3737

38-
#if LL_WINDOWS
39-
#pragma warning (push)
40-
#pragma warning (disable : 4702) // compiler thinks unreachable code
41-
#endif
4238
#include <boost/json/src.hpp>
43-
#if LL_WINDOWS
44-
#pragma warning (pop)
45-
#endif
46-
47-
4839

4940
//=========================================================================
5041
LLSD LlsdFromJson(const boost::json::value& val)

indra/llcommon/llstacktrace.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@
3333
#include <sstream>
3434

3535
#include "llwin32headerslean.h"
36-
#pragma warning (push)
37-
#pragma warning (disable:4091) // a microsoft header has warnings. Very nice.
3836
#include <dbghelp.h>
39-
#pragma warning (pop)
4037

4138
typedef USHORT NTAPI RtlCaptureStackBackTrace_Function(
4239
IN ULONG frames_to_skip,

indra/llcommon/llstring.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -900,6 +900,11 @@ void HeapFree_deleter(void* ptr)
900900

901901
} // anonymous namespace
902902

903+
unsigned long windows_get_last_error()
904+
{
905+
return GetLastError();
906+
}
907+
903908
template<>
904909
std::wstring windows_message<std::wstring>(DWORD error)
905910
{

indra/llcommon/llstring.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
#endif
4747

4848
#include <string.h>
49-
#include <boost/scoped_ptr.hpp>
5049

5150
const char LL_UNKNOWN_CHAR = '?';
5251
class LLSD;
@@ -832,8 +831,10 @@ template<>
832831
LL_COMMON_API std::wstring windows_message<std::wstring>(unsigned long error);
833832

834833
/// Get Windows message string, implicitly calling GetLastError()
834+
LL_COMMON_API unsigned long windows_get_last_error();
835+
835836
template<typename STRING>
836-
STRING windows_message() { return windows_message<STRING>(GetLastError()); }
837+
STRING windows_message() { return windows_message<STRING>(windows_get_last_error()); }
837838

838839
//@}
839840

indra/llcommon/lluuid.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
// ugh, this is ugly. We need to straighten out our linking for this library
3232
#pragma comment(lib, "IPHLPAPI.lib")
3333
#include <iphlpapi.h>
34+
#include <nb30.h>
3435
#endif
3536

3637
#include "llapp.h"

0 commit comments

Comments
 (0)