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

nuttx: fix <new> #22322

Merged
merged 1 commit into from
Nov 7, 2023
Merged

nuttx: fix <new> #22322

merged 1 commit into from
Nov 7, 2023

Conversation

robbie-sps
Copy link
Contributor

Solved Problem

When adding a new third-party library to our project (HFSM2, FWIW), I found that there were compilation issues with platforms/nuttx/NuttX/include/cxx/new:

/home/robbie/px4/platforms/nuttx/NuttX/include/cxx/new:34:34: error: declaration of 'operator new' as non-function
   34 | inline void* operator new  (std::size_t, void* ptr) { return ptr; }
      |                                  ^~~~~~

Despite the warning from the compiler, the error in my IDE (VSCode) reported that "namespace 'std' has no member 'size_t'"

I found that the compilation error went away when I included the library header later in my code, suggesting that something in the include chain could fix the error

Solution

  • Explicitly #include <cstddef> in platforms/nuttx/NuttX/include/cxx/new

@dagar dagar merged commit 55fd0bd into PX4:main Nov 7, 2023
84 of 86 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants