You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "Gary-Hobson (via GitHub)" <gi...@apache.org> on 2024/02/21 05:41:33 UTC

[PR] assert: change the do-while of assert to a conditional expression [nuttx]

Gary-Hobson opened a new pull request, #11734:
URL: https://github.com/apache/nuttx/pull/11734

   ## Summary
   assert: change the do-while of assert to a conditional expression
   
   According to the standard definition, assert should return a void expression
   https://pubs.opengroup.org/onlinepubs/007904875/basedefs/assert.h.html
   
   This patch involves two changes:
   
   If you define the NDEBUG macro, assert does not use any parameters and directly returns a void expression.
   assert should return a void expression and cannot use do-while statements.
   If the following code , a compilation error will occur.
   
   ## Impact
   
   ## Testing
   sim
   


-- 
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


Re: [PR] assert: change the do-while of assert to a conditional expression [nuttx]

Posted by "masayuki2009 (via GitHub)" <gi...@apache.org>.
masayuki2009 commented on PR #11734:
URL: https://github.com/apache/nuttx/pull/11734#issuecomment-1958460797

   I think we should revert this PR and fix all warnings before merging this PR.
   
   


-- 
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


Re: [PR] assert: change the do-while of assert to a conditional expression [nuttx]

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis merged PR #11734:
URL: https://github.com/apache/nuttx/pull/11734


-- 
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


Re: [PR] assert: change the do-while of assert to a conditional expression [nuttx]

Posted by "Gary-Hobson (via GitHub)" <gi...@apache.org>.
Gary-Hobson commented on PR #11734:
URL: https://github.com/apache/nuttx/pull/11734#issuecomment-1958712324

   @masayuki2009 I submitted a repair patch, which involves two repositories
   https://github.com/apache/nuttx-apps/pull/2302
   https://github.com/apache/nuttx/pull/11742


-- 
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


Re: [PR] assert: change the do-while of assert to a conditional expression [nuttx]

Posted by "masayuki2009 (via GitHub)" <gi...@apache.org>.
masayuki2009 commented on PR #11734:
URL: https://github.com/apache/nuttx/pull/11734#issuecomment-1958456464

   rv-virt:nsh
   
   ```
   riscv-none-elf-gcc -c -fno-common -Wall -Wstrict-prototypes -Wshadow -Wundef -Wno-attributes -Wno-unknown-pragmas -Wno-psabi -Os -fno-strict-aliasing -fomit-frame-pointer -ffunction-sections -fdata-sections -g -march=rv32imafdc_zicsr_zifencei -mabi=ilp32d -isystem /mnt/m2ssd/opensource/gh_masayuki2009/apache-nuttx-tmp/nuttx/include -D__NuttX__ -DNDEBUG  -pipe -I /mnt/m2ssd/opensource/gh_masayuki2009/apache-nuttx-tmp/nuttx/libs/libc    machine/risc-v/arch_elf.c -o  bin/arch_elf.o
   machine/risc-v/arch_elf.c: In function 'up_relocateadd':
   machine/risc-v/arch_elf.c:481:20: warning: variable 'insn' set but not used [-Wunused-but-set-variable]
     481 |           uint32_t insn;
         |                    ^~~~
   ```


-- 
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


Re: [PR] assert: change the do-while of assert to a conditional expression [nuttx]

Posted by "masayuki2009 (via GitHub)" <gi...@apache.org>.
masayuki2009 commented on PR #11734:
URL: https://github.com/apache/nuttx/pull/11734#issuecomment-1958443022

   I encountered a build error with qemu-armv8a:netnsh_smp_hv
   
   ```
   CC:  common/arm64_arch_timer.c
   aarch64-none-elf-gcc -c -D_LDBL_EQ_DBL -fno-common -Wall -Wstrict-prototypes -Wshadow -Wundef -Werror -Wno-attributes -Wno-unknown-pragmas -Wno-psabi -Os -fno-strict-aliasing -fomit-frame-pointer -ffunction-sections -fdata-sections -g -march=armv8-a -mcpu=cortex-a53 -isystem /mnt/m2ssd/opensource/RTOS/nuttx/nuttx/include -D__NuttX__ -DNDEBUG -D__KERNEL__  -pipe -I /mnt/m2ssd/opensource/RTOS/nuttx/nuttx/arch/arm64/src/chip -I /mnt/m2ssd/opensource/RTOS/nuttx/nuttx/arch/arm64/src/common -I /mnt/m2ssd/opensource/RTOS/nuttx/nuttx/sched    common/arm64_arch_timer.c -o  arm64_arch_timer.o
   common/arm64_arch_timer.c: In function 'arm64_tick_cancel':
   common/arm64_arch_timer.c:209:37: error: unused variable 'priv' [-Werror=unused-variable]
     209 |   struct arm64_oneshot_lowerhalf_s *priv =
         |                                     ^~~~
   cc1: all warnings being treated as errors
   ```


-- 
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


Re: [PR] assert: change the do-while of assert to a conditional expression [nuttx]

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on PR #11734:
URL: https://github.com/apache/nuttx/pull/11734#issuecomment-1958507188

   @acassis the ci doesn't pass yet:(.


-- 
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