Skip to content

Commit

Permalink
Bump clang-format to 1.8 to address CVE in async (#63)
Browse files Browse the repository at this point in the history
* Bump clang-format to 1.8 to address CVE in async

* Change files
  • Loading branch information
dannyvv authored May 11, 2022
1 parent b0adab9 commit b8bcfa4
Show file tree
Hide file tree
Showing 22 changed files with 271 additions and 234 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Bump clang-format to 1.8 to address CVE in async",
"packageName": "@microsoft/mso",
"email": "[email protected]",
"dependentChangeType": "patch"
}
6 changes: 4 additions & 2 deletions libs/compilerAdapters/include/compilerAdapters/linker.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
be included. Then, add the corresponding MSO_LINK_SYMBOL macro to one of the
source files that gets compiled directly into your binary (as an *.obj file)
*/
#define MSO_DEFINE_SYMBOL(symbol) \
extern "C" void __cdecl symbol() {}
#define MSO_DEFINE_SYMBOL(symbol) \
extern "C" void __cdecl symbol() \
{ \
}

// MSO_LINK_INCLUDE and MSO_LINK_SYMBOL macros are only needed for MSVC.
#if MS_TARGET_WINDOWS
Expand Down
2 changes: 1 addition & 1 deletion libs/cppExtensions/include/cppExtensions/stringLiteral.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ template <typename char_type>
class StringLiteral
{
public:
constexpr operator _Null_terminated_ const char_type *() const noexcept
constexpr operator _Null_terminated_ const char_type*() const noexcept
{
return m_string;
}
Expand Down
2 changes: 1 addition & 1 deletion libs/eventWaitHandle/src/eventWaitHandleImpl_posix.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

//#include "precomp.h"
// #include "precomp.h"
#include "eventWaitHandleImpl.h"
#include <pthread.h>

Expand Down
2 changes: 1 addition & 1 deletion libs/eventWaitHandle/src/eventWaitHandleImpl_win.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

//#include "precomp.h"
// #include "precomp.h"
#include "EventWaitHandleImpl.h"
#include <synchapi.h>
#include <algorithm>
Expand Down
2 changes: 1 addition & 1 deletion libs/future/include/future/details/ifuture.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ struct IFuture : IUnknown
virtual void AddContinuation(Mso::CntPtr<IFuture>&& continuation) noexcept = 0;

_Success_(
return ) virtual bool TryStartSetValue(_Out_ ByteArrayView& valueBuffer, bool crashIfFailed = false) noexcept = 0;
return) virtual bool TryStartSetValue(_Out_ ByteArrayView& valueBuffer, bool crashIfFailed = false) noexcept = 0;
virtual void Post() noexcept = 0;
virtual void StartAwaiting() noexcept = 0;
virtual bool TrySetSuccess(bool crashIfFailed = false) noexcept = 0;
Expand Down
4 changes: 2 additions & 2 deletions libs/future/include/future/details/resultTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ struct GetResultTraits<TFutureValue, TExecutor, TCallback, CallbackArgKind::Mayb
{
using Type = ResultTraits<
TFutureValue,
decltype(
std::declval<TExecutor>().Invoke(std::declval<TCallback>(), std::declval<Mso::Maybe<TFutureValue>&&>()))>;
decltype(std::declval<TExecutor>()
.Invoke(std::declval<TCallback>(), std::declval<Mso::Maybe<TFutureValue>&&>()))>;
static_assert(
noexcept(std::declval<TExecutor>().Invoke(std::declval<TCallback>(), std::declval<Mso::Maybe<TFutureValue>&&>())),
"Executor's Invoke method must not throw");
Expand Down
2 changes: 1 addition & 1 deletion libs/future/src/futureImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ class FutureImpl final : public Mso::QueryCastList<Mso::QueryCastDerived<FutureI
void AddContinuation(Mso::CntPtr<IFuture>&& continuation) noexcept override;

_Success_(
return ) bool TryStartSetValue(_Out_ ByteArrayView& valueBuffer, bool crashIfFailed = false) noexcept override;
return) bool TryStartSetValue(_Out_ ByteArrayView& valueBuffer, bool crashIfFailed = false) noexcept override;
void Post() noexcept override;
void StartAwaiting() noexcept override;
bool TrySetSuccess(bool crashIfFailed = false) noexcept override;
Expand Down
2 changes: 1 addition & 1 deletion libs/guid/include/guid/msoGuidDetails.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ See the msoGuid.h for the usage guidelines.
#endif

// Clang compiler must target C++11 or up to support MSO*GUIDs because we rely on constexpr.
//#if (__cplusplus >= 201103L) && !defined(MSO_GUID_DISABLED)
// #if (__cplusplus >= 201103L) && !defined(MSO_GUID_DISABLED)

#include <compilerAdapters/compilerFeatures.h>
#include <compilerAdapters/compilerWarnings.h>
Expand Down
2 changes: 1 addition & 1 deletion libs/memoryApi/include/memoryApi/memoryApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ enum Enum : unsigned int
// track this memory using memory marking / idle time leak detection
MarkingLeak = 0x0004,
};
}
} // namespace AllocFlags

/**
Return a new allocation of the requested size (cb)
Expand Down
46 changes: 26 additions & 20 deletions libs/motifCpp/include/motifCpp/testInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,39 @@
#include <vector>
#include "motifCpp/motifCppTestBase.h"

#define TEST_CLASS(className) \
struct className; \
\
struct TestClassInfo_##className final \
: Mso::UnitTests::Internal::TestClassInfoReg<TestClassInfo_##className, className> \
{ \
TestClassInfo_##className() noexcept : TestClassInfoRegType{#className, __FILE__, __LINE__} {} \
}; \
\
#define TEST_CLASS(className) \
struct className; \
\
struct TestClassInfo_##className final \
: Mso::UnitTests::Internal::TestClassInfoReg<TestClassInfo_##className, className> \
{ \
TestClassInfo_##className() noexcept : TestClassInfoRegType{#className, __FILE__, __LINE__} \
{ \
} \
}; \
\
struct className : Mso::UnitTests::Internal::TestClassBase<className, TestClassInfo_##className>

#define TEST_CLASS_EX(className, baseClass) \
struct className; \
\
struct TestClassInfo_##className final \
: baseClass \
, Mso::UnitTests::Internal::TestClassInfoReg<TestClassInfo_##className, className> \
{ \
TestClassInfo_##className() noexcept : baseClass{}, TestClassInfoRegType{#className, __FILE__, __LINE__} {} \
}; \
\
#define TEST_CLASS_EX(className, baseClass) \
struct className; \
\
struct TestClassInfo_##className final \
: baseClass \
, Mso::UnitTests::Internal::TestClassInfoReg<TestClassInfo_##className, className> \
{ \
TestClassInfo_##className() noexcept : baseClass{}, TestClassInfoRegType{#className, __FILE__, __LINE__} \
{ \
} \
}; \
\
struct className : Mso::UnitTests::Internal::TestClassBase<className, TestClassInfo_##className>

#define TEST_METHOD(methodName) \
struct TestMethodInfo_##methodName final : Mso::UnitTests::Internal::TestMethodInfoReg<TestMethodInfo_##methodName> \
{ \
TestMethodInfo_##methodName() : TestMethodInfoRegType{TestClassInfoType::Instance, #methodName, __LINE__} {} \
TestMethodInfo_##methodName() : TestMethodInfoRegType{TestClassInfoType::Instance, #methodName, __LINE__} \
{ \
} \
\
void Invoke(Mso::UnitTests::TestClass& test) const override \
{ \
Expand Down
2 changes: 1 addition & 1 deletion libs/motifCpp/tests/motifCppTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "motifCpp/testCheck.h"

// Uncomment to see errors
//#define MOTIF_TEST_SHOW_ERRORS
// #define MOTIF_TEST_SHOW_ERRORS

TEST_CLASS (MotifCppTest)
{
Expand Down
Loading

0 comments on commit b8bcfa4

Please sign in to comment.