Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix minor build errors for clang compiler #1369

Merged
merged 2 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion build/target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,14 @@ ELSEIF (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
-fvisibility=hidden
-fno-fast-math -fno-unsafe-math-optimizations -fdenormal-fp-math=ieee
-Wno-type-limits -Wno-unused-result -Wno-unused-variable -Wno-invalid-offsetof -Wno-unused-function
-Wno-deprecated-declarations -Wno-unsupported-floating-point-opt -Wno-parentheses-equality -Wno-dynamic-class-memaccess -Wno-deprecated-register
-Wno-deprecated-declarations -Wno-parentheses-equality -Wno-dynamic-class-memaccess -Wno-deprecated-register
-Wno-expansion-to-defined -Wno-return-type -Wno-overloaded-virtual -Wno-unused-private-field -Wno-deprecated-copy -Wno-atomic-alignment
-Wno-ambiguous-reversed-operator -Wno-deprecated-enum-enum-conversion -Wno-deprecated-enum-float-conversion -Wno-braced-scalar-init -Wno-unused-parameter
)
IF (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 10)
# this feature supported after clang version 11
SET (ESCARGOT_CXXFLAGS ${ESCARGOT_CXXFLAGS} -Wno-unsupported-floating-point-opt)
endif()
SET (ESCARGOT_CXXFLAGS_DEBUG -O0 -Wall -Wextra -Werror)
SET (ESCARGOT_CXXFLAGS_RELEASE -O2 -fno-stack-protector -fno-omit-frame-pointer)
SET (ESCARGOT_THIRDPARTY_CFLAGS -w -g3 -fdata-sections -ffunction-sections -fno-omit-frame-pointer -fvisibility=hidden)
Expand Down
2 changes: 1 addition & 1 deletion src/parser/Lexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1779,7 +1779,7 @@ void Scanner::scanTemplate(Scanner::ScannerResult* token, bool head)
}
break;
}
auto endIndex = this->index;
auto endIndex = this->eof() ? this->length : this->index;
for (size_t i = currentIndex; i < endIndex; i++) {
raw += this->sourceCharAt(i);
}
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/BooleanObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class BooleanObject : public DerivedObject {
m_primitiveValue = val;
}

virtual bool isBooleanObject() const
virtual bool isBooleanObject() const override
{
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/DateObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class DateObject : public DerivedObject {
return IS_VALID_TIME(m_primitiveValue);
}

virtual bool isDateObject() const
virtual bool isDateObject() const override
{
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/ErrorObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class ErrorObject : public DerivedObject {
ErrorObject(ExecutionState& state, Object* proto, String* errorMessage, bool fillStackInfo = true, bool triggerCallback = false);
void updateStackTraceData(ExecutionState& state);

virtual bool isErrorObject() const
virtual bool isErrorObject() const override
{
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/ExtendedNativeFunctionObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace Escargot {

class ExtendedNativeFunctionObject : public NativeFunctionObject {
public:
virtual bool isExtendedNativeFunctionObject() const
virtual bool isExtendedNativeFunctionObject() const override
{
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/FinalizationRegistryObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class FinalizationRegistryObject : public DerivedObject {
explicit FinalizationRegistryObject(ExecutionState& state, Object* cleanupCallback, Context* realm);
explicit FinalizationRegistryObject(ExecutionState& state, Object* proto, Object* cleanupCallback, Context* realm);

virtual bool isFinalizationRegistryObject() const
virtual bool isFinalizationRegistryObject() const override
{
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/IteratorObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class IteratorObject : public DerivedObject {
explicit IteratorObject(ExecutionState& state);
explicit IteratorObject(ExecutionState& state, Object* proto);

virtual bool isIteratorObject() const
virtual bool isIteratorObject() const override
{
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/NumberObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class NumberObject : public DerivedObject {
m_primitiveValue = data;
}

virtual bool isNumberObject() const
virtual bool isNumberObject() const override
{
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/Object.h
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ class JSGetterSetter : public PointerValue {
ASSERT(setter.isEmpty() || setter.isCallable() || setter.isUndefined());
}

virtual bool isJSGetterSetter() const
virtual bool isJSGetterSetter() const override
{
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/PromiseObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class PromiseObject : public DerivedObject {
explicit PromiseObject(ExecutionState& state);
explicit PromiseObject(ExecutionState& state, Object* proto);

virtual bool isPromiseObject() const
virtual bool isPromiseObject() const override
{
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/TypedArrayObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class TypedArrayPrototypeObject : public DerivedObject {
{
}

virtual bool isTypedArrayPrototypeObject() const
virtual bool isTypedArrayPrototypeObject() const override
{
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/WeakMapObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class WeakMapObject : public DerivedObject {
explicit WeakMapObject(ExecutionState& state);
explicit WeakMapObject(ExecutionState& state, Object* proto);

virtual bool isWeakMapObject() const
virtual bool isWeakMapObject() const override
{
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/WeakRefObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class WeakRefObject : public DerivedObject {
explicit WeakRefObject(ExecutionState& state, PointerValue* target);
explicit WeakRefObject(ExecutionState& state, Object* proto, PointerValue* target);

virtual bool isWeakRefObject() const
virtual bool isWeakRefObject() const override
{
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/WeakSetObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class WeakSetObject : public DerivedObject {
explicit WeakSetObject(ExecutionState& state);
explicit WeakSetObject(ExecutionState& state, Object* proto);

virtual bool isWeakSetObject() const
virtual bool isWeakSetObject() const override
{
return true;
}
Expand Down
Loading