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/07/11 15:26:40 UTC
[GitHub] [incubator-nuttx] hartmannathan opened a new pull request, #6598: Fix compiler warnings (-Wunused-parameter) in various functions
hartmannathan opened a new pull request, #6598:
URL: https://github.com/apache/incubator-nuttx/pull/6598
## Summary
Fix the `-Wunused-parameter` warning in:
- group/group_signal.c: group_signal()
- irq/irq_unexpectedisr.c: irq_unexpected_isr()
- task/task_spawn.c: nxtask_spawn_proxy()
- timer/timer_getoverrun.c: timer_getoverrun()
- misc/dev_null.c: devnull_read(), devnull_write(), devnull_poll()
- misc/dev_zero.c: devzero_read(), devzero_write(), devzero_poll()
- syslog/syslog_channel.c: syslog_default_write()
- syslog/syslog_device.c: syslog_dev_flush()
- grp/lib_initgroups.c: initgroups()
- misc/lib_mknod.c: mknod()
- misc/lib_glob.c: ignore_err()
- pthread/pthread_barrierinit.c: pthread_barrier_init()
- pthread/pthread_atfork.c: pthread_atfork()
- semaphore/sem_init.c: nxsem_init()
- stream/lib_nullinstream.c: nullinstream_getc()
- stream/lib_nulloutstream.c: nulloutstream_putc()
- stream/lib_libnoflush.c: lib_noflush()
- stream/lib_libsnoflush.c: lib_snoflush()
- string/lib_strerror.c: strerror()
- time/lib_gettimeofday.c: gettimeofday()
- time/lib_settimeofday.c: settimeofday()
- unistd/lib_pathconf.c: fpathconf(), pathconf()
- unistd/lib_getrusage.c: getrusage()
- unistd/lib_setrlimit.c: setrlimit()
- unistd/lib_getrlimit.c: getrlimit()
- unistd/lib_setpriority.c: setpriority()
## Impact
Clears many compiler warnings when building with, e.g., `-Wextra`, etc.
## Testing
- build testing
- nxstyle
--
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 pull request #6598: Fix compiler warnings (-Wunused-parameter) in various functions
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on PR #6598:
URL: https://github.com/apache/incubator-nuttx/pull/6598#issuecomment-1181254500
> > Do we plan to enable -Wunused-parameter which affect many code?
>
> Personally I like to compile with -Wextra because it catches subtle mistakes and has prevented some nasty bugs from getting into my software on a few occasions. I don't have a strong opinion whether NuttX should do this upstream but fixing the warnings in this PR helps eliminate many nuisance messages when someone chooses to compile with -Wextra (which I think is a good idea).
>
Yes, I think it's good to enable -Wextra in general.
> Also many functions use the UNUSED() macro to mark parameters and variables which are deliberately unused, so I think it should be done for consistency wherever practical.
But, not all warning in -Wextra is reasonable. -Wunused-parameter is one of them since sometime function prototype is defined by the standard or other people with extra arguments to make it more flexible.
So, I think it's more reasonable to disable some harmless warning when we enable -Wextra.
--
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 #6598: Fix compiler warnings (-Wunused-parameter) in various functions
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #6598:
URL: https://github.com/apache/incubator-nuttx/pull/6598
--
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 pull request #6598: Fix compiler warnings (-Wunused-parameter) in various functions
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on PR #6598:
URL: https://github.com/apache/incubator-nuttx/pull/6598#issuecomment-1180656678
Do we plan to enable -Wunused-parameter which affect many code?
--
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] hartmannathan commented on pull request #6598: Fix compiler warnings (-Wunused-parameter) in various functions
Posted by GitBox <gi...@apache.org>.
hartmannathan commented on PR #6598:
URL: https://github.com/apache/incubator-nuttx/pull/6598#issuecomment-1180698546
> Do we plan to enable -Wunused-parameter which affect many code?
Personally I like to compile with -Wextra because it catches subtle mistakes and has prevented some nasty bugs from getting into my software on a few occasions. I don't have a strong opinion whether NuttX should do this upstream but fixing the warnings in this PR helps eliminate many nuisance messages when someone chooses to compile with -Wextra (which I think is a good idea).
Also many functions use the UNUSED() macro to mark parameters and variables which are deliberately unused, so I think it should be done for consistency wherever practical.
--
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