Skip to content

Commit

Permalink
Remove legacy compiler build options (#2775)
Browse files Browse the repository at this point in the history
Remove `__GXX_EXPERIMENTAL_CXX0X__`, it's for obsolete compiler versions.

Enable deprecated warnings for Host builds. These were originally masked but there's currently no reason for it.
  • Loading branch information
mikee47 authored May 27, 2024
1 parent 7d69a58 commit 2cac913
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 19 deletions.
1 change: 0 additions & 1 deletion Sming/Arch/Host/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ GCC_UPGRADE_URL := https://sming.readthedocs.io/en/latest/arch/host/host-emulato

CPPFLAGS += \
-m32 \
-Wno-deprecated-declarations \
-D_FILE_OFFSET_BITS=64 \
-D_TIME_BITS=64

Expand Down
3 changes: 1 addition & 2 deletions Sming/Core/Data/CStringArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,15 @@ class CStringArray : private String
init();
}

#ifdef __GXX_EXPERIMENTAL_CXX0X__
CStringArray(String&& rval) noexcept : String(std::move(rval))
{
init();
}

CStringArray(StringSumHelper&& rval) noexcept : String(std::move(rval))
{
init();
}
#endif
/** @} */

CStringArray& operator=(const char* cstr)
Expand Down
6 changes: 0 additions & 6 deletions Sming/Wiring/WString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,10 @@ String::String(const char* cstr) : String()
copy(cstr, strlen(cstr));
}

#ifdef __GXX_EXPERIMENTAL_CXX0X__
String::String(StringSumHelper&& rval) noexcept : String()
{
move(rval);
}
#endif

String::String(char c) : String()
{
Expand Down Expand Up @@ -265,7 +263,6 @@ String& String::copy(flash_string_t pstr, size_t length)
return *this;
}

#ifdef __GXX_EXPERIMENTAL_CXX0X__
void String::move(String& rhs)
{
if(rhs.isNull()) {
Expand Down Expand Up @@ -300,7 +297,6 @@ void String::move(String& rhs)
rhs.ptr.capacity = 0;
rhs.ptr.len = 0;
}
#endif

String& String::operator=(const String& rhs)
{
Expand All @@ -316,15 +312,13 @@ String& String::operator=(const String& rhs)
return *this;
}

#ifdef __GXX_EXPERIMENTAL_CXX0X__
String& String::operator=(StringSumHelper&& rval) noexcept
{
if(this != &rval) {
move(rval);
}
return *this;
}
#endif

String& String::operator=(const char* cstr)
{
Expand Down
10 changes: 0 additions & 10 deletions Sming/Wiring/WString.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@
*/
using FlashString = FSTR::String;

#ifndef __GXX_EXPERIMENTAL_CXX0X__
#define __GXX_EXPERIMENTAL_CXX0X__
#endif

// When compiling programs with this class, the following gcc parameters
// dramatically increase performance and memory (RAM) efficiency, typically
// with little or no increase in code size.
Expand Down Expand Up @@ -184,13 +180,11 @@ class String
setString(pstr);
}

#ifdef __GXX_EXPERIMENTAL_CXX0X__
String(String&& rval) noexcept : String()
{
move(rval);
}
String(StringSumHelper&& rval) noexcept;
#endif
explicit String(char c);
explicit String(unsigned char, unsigned char base = DEC, unsigned char width = 0, char pad = '0');
explicit String(int num, unsigned char base = DEC, unsigned char width = 0, char pad = '0')
Expand Down Expand Up @@ -300,15 +294,13 @@ class String
*
* @{
*/
#ifdef __GXX_EXPERIMENTAL_CXX0X__
String& operator=(String&& rval) noexcept
{
if(this != &rval)
move(rval);
return *this;
}
String& operator=(StringSumHelper&& rval) noexcept;
#endif
/** @} */

/**
Expand Down Expand Up @@ -882,9 +874,7 @@ class String
// copy and move
String& copy(const char* cstr, size_t length);
String& copy(flash_string_t pstr, size_t length);
#ifdef __GXX_EXPERIMENTAL_CXX0X__
void move(String& rhs);
#endif
};

/** @} */
Expand Down

0 comments on commit 2cac913

Please sign in to comment.