Skip to content

Commit

Permalink
Revert "Provide workaround for 'dangling pointer' error/warning (Smin…
Browse files Browse the repository at this point in the history
…gHub#2671)"

This reverts commit a0585b2.
  • Loading branch information
mikee47 committed Oct 12, 2023
1 parent a0585b2 commit 25c96e6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Sming/Components/FlashString
7 changes: 0 additions & 7 deletions Sming/Wiring/FakePgmSpace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,3 @@ int memcmp_aligned(const void* ptr1, const void* ptr2, unsigned len)
auto tail2 = pgm_read_dword(reinterpret_cast<const uint8_t*>(ptr2) + len_aligned);
return memcmp(&tail1, &tail2, len - len_aligned);
}

#ifdef ARCH_HOST
char* smg_return_local(char* buf)
{
return buf;
}
#endif
9 changes: 1 addition & 8 deletions Sming/Wiring/FakePgmSpace.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,6 @@ extern "C" {
&__pstr__[0]; \
}))

#ifdef ARCH_HOST
// Internal function to prevent 'dangling pointer' compiler warning
extern char* smg_return_local(char* buf);
#else
#define smg_return_local(buf) (buf)
#endif

/**
* @brief Declare and use a flash string inline.
* @param str
Expand All @@ -91,7 +84,7 @@ extern char* smg_return_local(char* buf);
(__extension__({ \
DEFINE_PSTR_LOCAL(__pstr__, str); \
LOAD_PSTR(buf, __pstr__); \
smg_return_local(buf); \
buf; \
}))

/**
Expand Down

0 comments on commit 25c96e6

Please sign in to comment.