[PATCH] cpukit/dosfs: Cast away ignored return

Kinsey Moore kinsey.moore at oarcorp.com
Thu Jan 4 23:20:15 UTC 2024


The style in existing code displays both variants and the coding standards
document isn't clear on the matter that I could find other than giving a
demonstration of voiding an unused function argument that does have the
space. Other commentary about spaces and parens deals with conditionals.

On Thu, Jan 4, 2024 at 5:04 PM Joel Sherrill <joel at rtems.org> wrote:

> Don't we put a space after the (void)?
>
> On Thu, Jan 4, 2024 at 12:55 PM Kinsey Moore <kinsey.moore at oarcorp.com>
> wrote:
>
>> An error is already being reported. Checking the return value of this
>> function is not useful.
>> ---
>>  cpukit/libfs/src/dosfs/msdos_file.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/cpukit/libfs/src/dosfs/msdos_file.c
>> b/cpukit/libfs/src/dosfs/msdos_file.c
>> index d142968337..6728a960aa 100644
>> --- a/cpukit/libfs/src/dosfs/msdos_file.c
>> +++ b/cpukit/libfs/src/dosfs/msdos_file.c
>> @@ -179,7 +179,7 @@ msdos_file_ftruncate(rtems_libio_t *iop, off_t length)
>>                               length,
>>                               &new_length);
>>          if (rc == RC_OK && length != new_length) {
>> -            fat_file_truncate(&fs_info->fat, fat_fd, old_length);
>> +            (void)fat_file_truncate(&fs_info->fat, fat_fd, old_length);
>>              errno = ENOSPC;
>>              rc = -1;
>>          }
>> --
>> 2.39.2
>>
>> _______________________________________________
>> devel mailing list
>> devel at rtems.org
>> http://lists.rtems.org/mailman/listinfo/devel
>>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20240104/6dde0089/attachment-0001.htm>


More information about the devel mailing list