apache / nuttx-apps

Apache NuttX Apps is a collection of tools, shells, network utilities, libraries, interpreters and can be used with the NuttX RTOS
https://nuttx.apache.org/
Apache License 2.0
268 stars 504 forks source link

system/libuv: fix compiler warning of "container_of" redefined #2314

Closed anchao closed 5 months ago

anchao commented 5 months ago

Summary

system/libuv: fix compiler warning of "container_of" redefined

    In file included from libuv/test/runner.c:27:
    libuv/test/task.h:74: warning: "container_of" redefined
       74 | #define container_of(ptr, type, member) \
          |
    In file included from /home/archer/code/nuttx/n2/nuttx/include/nuttx/list.h:47,
                     from /home/archer/code/nuttx/n2/nuttx/include/nuttx/tls.h:34,
                     from /home/archer/code/nuttx/n2/nuttx/include/nuttx/sched.h:48,
                     from /home/archer/code/nuttx/n2/nuttx/include/nuttx/arch.h:87,
                     from /home/archer/code/nuttx/n2/nuttx/include/nuttx/userspace.h:35,
                     from /home/archer/code/nuttx/n2/nuttx/include/nuttx/mm/mm.h:30,
                     from /home/archer/code/nuttx/n2/nuttx/include/nuttx/kmalloc.h:34,
                     from /home/archer/code/nuttx/n2/nuttx/include/nuttx/lib/lib.h:31,
                     from /home/archer/code/nuttx/n2/nuttx/include/stdio.h:35,
                     from libuv/test/runner.c:22:
    /home/archer/code/nuttx/n2/nuttx/include/nuttx/nuttx.h:48: note: this is the location of the previous definition
       48 | #define container_of(ptr, type, member) \
          |

Signed-off-by: chao an anchao@lixiang.com

Impact

N/A

Testing

ci-check

xiaoxiang781216 commented 5 months ago

could we avoid introduce container_of in the common header file?

anchao commented 5 months ago

could we avoid introduce container_of in the common header file?

OK, I moved the task_info_s into sched.h to resolve the include issue, let us close this PR