You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/08/15 21:17:51 UTC
[GitHub] [incubator-nuttx] DuaneSkelton opened a new pull request, #6860: Added extern C {} wrapper consistent with other headers in include/sys
DuaneSkelton opened a new pull request, #6860:
URL: https://github.com/apache/incubator-nuttx/pull/6860
## Summary
Added a call to uname() from a c++ application and got a linker error for undefined reference to uname()
```bash
LD: nuttx
arm-none-eabi-ld: /home/local/KYMETA/dskelton/github-forks/nuttx/staging/libapps.a(helloxx_main.cxx.home.local.KYMETA.dskelton.github-forks.apps.examples.helloxx.o): in function `helloxx_main':
helloxx_main.cxx:(.text.helloxx_main+0x42): undefined reference to `uname(utsname*)'
make[1]: *** [Makefile:159: nuttx] Error 1
make[1]: Leaving directory '/home/local/KYMETA/dskelton/github-forks/nuttx/arch/arm/src'
make: *** [tools/Unix.mk:509: nuttx] Error 2
```
Found that the uname() function was part of the libc.a generated by our project and investigated this header file and found that it was not set up to allow linkage from a c++ file. Also noticed that this was the only header in the include/sys folder with no extern C {} wrapper for function prototypes.
## Impact
Unable to call uname() from a c++ program
## Testing
This change, when applied to our product code, compiled cleanly and the uname() API worked as expected.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] acassis commented on pull request #6860: Added extern C {} wrapper consistent with other headers in include/sys
Posted by GitBox <gi...@apache.org>.
acassis commented on PR #6860:
URL: https://github.com/apache/incubator-nuttx/pull/6860#issuecomment-1215980842
Thank you @DuaneSkelton !
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #6860: Added extern C {} wrapper consistent with other headers in include/sys
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #6860:
URL: https://github.com/apache/incubator-nuttx/pull/6860
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org