You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/08/17 07:00:25 UTC

[incubator-nuttx] branch master updated: sched: fix visual studio Compiler Warning (level 4) C4189

This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 6e5908cc92 sched: fix visual studio Compiler Warning (level 4) C4189
6e5908cc92 is described below

commit 6e5908cc92a9c9f0434bf1eedcb02d9d6c080c4d
Author: chao.an <an...@xiaomi.com>
AuthorDate: Wed Aug 17 12:22:03 2022 +0800

    sched: fix visual studio Compiler Warning (level 4) C4189
    
    D:\code\incubator-nuttx\sched\pthread\pthread_create.c(154,22):
      warning C4189: “pjoin”: local variable is initialized but not referenced
      [D:\code\incubator-nuttx\vs20221\sched\sched.vcxproj]
    
    D:\code\incubator-nuttx\sched\group\group_setupidlefiles.c(61,28):
      warning C4189: “group”: local variable is initialized but not referenced
      [D:\code\incubator-nuttx\vs20221\sched\sched.vcxproj]
    
    Reference:
    https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4189?view=msvc-170
    
    Signed-off-by: chao.an <an...@xiaomi.com>
---
 sched/group/group_setupidlefiles.c | 3 +--
 sched/pthread/pthread_create.c     | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/sched/group/group_setupidlefiles.c b/sched/group/group_setupidlefiles.c
index d0276ee149..912d2eb57b 100644
--- a/sched/group/group_setupidlefiles.c
+++ b/sched/group/group_setupidlefiles.c
@@ -58,12 +58,11 @@
 
 int group_setupidlefiles(FAR struct task_tcb_s *tcb)
 {
-  FAR struct task_group_s *group = tcb->cmn.group;
 #ifdef CONFIG_DEV_CONSOLE
   int fd;
 #endif
 
-  DEBUGASSERT(group != NULL);
+  DEBUGASSERT(tcb->cmn.group != NULL);
 
   /* Open stdin, dup to get stdout and stderr. This should always
    * be the first file opened and, hence, should always get file
diff --git a/sched/pthread/pthread_create.c b/sched/pthread/pthread_create.c
index 66bde29ce9..9ba789b575 100644
--- a/sched/pthread/pthread_create.c
+++ b/sched/pthread/pthread_create.c
@@ -151,9 +151,8 @@ static inline void pthread_addjoininfo(FAR struct task_group_s *group,
 static void pthread_start(void)
 {
   FAR struct pthread_tcb_s *ptcb = (FAR struct pthread_tcb_s *)this_task();
-  FAR struct join_s *pjoin = (FAR struct join_s *)ptcb->joininfo;
 
-  DEBUGASSERT(pjoin != NULL);
+  DEBUGASSERT(ptcb->joininfo != NULL);
 
   /* The priority of this thread may have been boosted to avoid priority
    * inversion problems.  If that is the case, then drop to the correct