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/21 07:28:12 UTC
[GitHub] [incubator-nuttx] anchao opened a new pull request, #6887: sched: fix visual studio compiler error
anchao opened a new pull request, #6887:
URL: https://github.com/apache/incubator-nuttx/pull/6887
## Summary
sched: fix visual studio compiler error
GCC __attribute__ is not fully compatible with MSVC, In the MSVC
environment the programmer typically explicitly exports function/class
symbols via the MSVC-specific __declspec(dllexport) modifier.
```
D:\code\incubator-nuttx\arch\sim\src\sim\up_head.c(107,15):
error C2143: syntax error : missing ')' before '('
[D:\code\n3\incubator-nuttx\vs2022\up_head.vcxproj]
```
Reference:
https://docs.microsoft.com/en-us/cpp/cpp/dllexport-dllimport?view=msvc-170
Signed-off-by: chao.an <an...@xiaomi.com>
## Impact
N/A
## Testing
Visual studio + cmake
--
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 commented on a diff in pull request #6887: sched: fix visual studio compiler error
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #6887:
URL: https://github.com/apache/incubator-nuttx/pull/6887#discussion_r951034509
##########
arch/sim/src/Makefile:
##########
@@ -78,8 +78,12 @@ endif
VPATH = sim
DEPPATH = $(patsubst %,--dep-path %,$(subst :, ,$(VPATH)))
+CFLAGS += -fvisibility=default
HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
- $(ARCHCFLAGS) $(HOSTINCLUDES) $(EXTRAFLAGS) -D__SIM__ -pipe
+ $(ARCHCFLAGS) $(HOSTINCLUDES) $(EXTRAFLAGS) -D__SIM__ -pipe \
+ -fvisibility=default
+
+sim/up_head.c_CFLAGS += -fvisibility=default
Review Comment:
remove this one
--
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] anchao commented on a diff in pull request #6887: sched: fix visual studio compiler error
Posted by GitBox <gi...@apache.org>.
anchao commented on code in PR #6887:
URL: https://github.com/apache/incubator-nuttx/pull/6887#discussion_r950943135
##########
arch/sim/src/sim/up_head.c:
##########
@@ -105,7 +105,7 @@ static void allsyms_relocate(void)
*
****************************************************************************/
-__attribute__ ((visibility("default")))
+import_symbol
Review Comment:
Done
--
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 commented on a diff in pull request #6887: sched: fix visual studio compiler error
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #6887:
URL: https://github.com/apache/incubator-nuttx/pull/6887#discussion_r950830025
##########
arch/sim/src/sim/up_head.c:
##########
@@ -105,7 +105,7 @@ static void allsyms_relocate(void)
*
****************************************************************************/
-__attribute__ ((visibility("default")))
+import_symbol
Review Comment:
let's add this option to HOSTFLAGS:
```
-fvisibility=default
```
and remove all __attribute__ ((visibility("default"))) directly.
--
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 #6887: sched: fix visual studio compiler error
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #6887:
URL: https://github.com/apache/incubator-nuttx/pull/6887
--
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