[ 
https://issues.apache.org/jira/browse/MYNEWT-688?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jeff Chan updated MYNEWT-688:
-----------------------------
    Description: 
Using docker image (local toolchain gcc-5 install seems to avoid these warnings)
mynewt/newt                     latest              190ce9ee7de9        5 days 
ago          1.05 GB


Compile fails for native sim target.  Would love to help, but unsure what the 
official way to ignore the return value is.  GCC compile flag? Macro that uses 
and discards the result?

Error: repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c: In function 
'hal_uart_blocking_tx':
repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c:317:5: error: ignoring 
return value of 'write', declared with attribute warn_unused_result 
[-Werror=unused-result]
     (void) write(uarts[port].u_fd, &data, sizeof(data));
     ^
repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c: In function 'uart_pty':
repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c:267:9: error: ignoring 
return value of 'write', declared with attribute warn_unused_result 
[-Werror=unused-result]
         write(1, msg, sizeof(msg));
         ^
repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c:276:5: error: ignoring 
return value of 'write', declared with attribute warn_unused_result 
[-Werror=unused-result]
     write(1, msg, strlen(msg));
     ^
repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c: In function 
'uart_set_attr':
repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c:240:9: error: ignoring 
return value of 'write', declared with attribute warn_unused_result 
[-Werror=unused-result]
         write(1, msg, sizeof(msg));
         ^
repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c:251:9: error: ignoring 
return value of 'write', declared with attribute warn_unused_result 
[-Werror=unused-result]
         write(1, msg, sizeof(msg));
         ^
repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c: In function 
'set_nonblock':
repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c:223:9: error: ignoring 
return value of 'write', declared with attribute warn_unused_result 
[-Werror=unused-result]
         write(1, msg, sizeof(msg));
         ^
repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c:228:9: error: ignoring 
return value of 'write', declared with attribute warn_unused_result 
[-Werror=unused-result]
         write(1, msg, sizeof(msg));
         ^
Error: repos/apache-mynewt-core/hw/mcu/native/src/hal_system.c: In function 
'usage':
repos/apache-mynewt-core/hw/mcu/native/src/hal_system.c:58:5: error: ignoring 
return value of 'write', declared with attribute warn_unused_result 
[-Werror=unused-result]
     (void) write(2, msg, strlen(msg));
     ^
cc1: all warnings being treated as errors


  was:
Using docker image
mynewt/newt                     latest              190ce9ee7de9        5 days 
ago          1.05 GB


Compile fails for native sim target.  Would love to help, but unsure what the 
official way to ignore the return value is.  GCC compile flag? Macro that uses 
and discards the result?

Error: repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c: In function 
'hal_uart_blocking_tx':
repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c:317:5: error: ignoring 
return value of 'write', declared with attribute warn_unused_result 
[-Werror=unused-result]
     (void) write(uarts[port].u_fd, &data, sizeof(data));
     ^
repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c: In function 'uart_pty':
repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c:267:9: error: ignoring 
return value of 'write', declared with attribute warn_unused_result 
[-Werror=unused-result]
         write(1, msg, sizeof(msg));
         ^
repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c:276:5: error: ignoring 
return value of 'write', declared with attribute warn_unused_result 
[-Werror=unused-result]
     write(1, msg, strlen(msg));
     ^
repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c: In function 
'uart_set_attr':
repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c:240:9: error: ignoring 
return value of 'write', declared with attribute warn_unused_result 
[-Werror=unused-result]
         write(1, msg, sizeof(msg));
         ^
repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c:251:9: error: ignoring 
return value of 'write', declared with attribute warn_unused_result 
[-Werror=unused-result]
         write(1, msg, sizeof(msg));
         ^
repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c: In function 
'set_nonblock':
repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c:223:9: error: ignoring 
return value of 'write', declared with attribute warn_unused_result 
[-Werror=unused-result]
         write(1, msg, sizeof(msg));
         ^
repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c:228:9: error: ignoring 
return value of 'write', declared with attribute warn_unused_result 
[-Werror=unused-result]
         write(1, msg, sizeof(msg));
         ^
Error: repos/apache-mynewt-core/hw/mcu/native/src/hal_system.c: In function 
'usage':
repos/apache-mynewt-core/hw/mcu/native/src/hal_system.c:58:5: error: ignoring 
return value of 'write', declared with attribute warn_unused_result 
[-Werror=unused-result]
     (void) write(2, msg, strlen(msg));
     ^
cc1: all warnings being treated as errors



> error: ignoring return value of 'write', declared with attribute 
> warn_unused_result
> -----------------------------------------------------------------------------------
>
>                 Key: MYNEWT-688
>                 URL: https://issues.apache.org/jira/browse/MYNEWT-688
>             Project: Mynewt
>          Issue Type: Bug
>          Components: HAL
>    Affects Versions: v1_0_0_beta1
>         Environment: OS X w/ newt docker container
>            Reporter: Jeff Chan
>            Assignee: Marko Kiiskila
>            Priority: Minor
>             Fix For: v1_0_0_rel
>
>
> Using docker image (local toolchain gcc-5 install seems to avoid these 
> warnings)
> mynewt/newt                     latest              190ce9ee7de9        5 
> days ago          1.05 GB
> Compile fails for native sim target.  Would love to help, but unsure what the 
> official way to ignore the return value is.  GCC compile flag? Macro that 
> uses and discards the result?
> Error: repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c: In function 
> 'hal_uart_blocking_tx':
> repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c:317:5: error: ignoring 
> return value of 'write', declared with attribute warn_unused_result 
> [-Werror=unused-result]
>      (void) write(uarts[port].u_fd, &data, sizeof(data));
>      ^
> repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c: In function 'uart_pty':
> repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c:267:9: error: ignoring 
> return value of 'write', declared with attribute warn_unused_result 
> [-Werror=unused-result]
>          write(1, msg, sizeof(msg));
>          ^
> repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c:276:5: error: ignoring 
> return value of 'write', declared with attribute warn_unused_result 
> [-Werror=unused-result]
>      write(1, msg, strlen(msg));
>      ^
> repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c: In function 
> 'uart_set_attr':
> repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c:240:9: error: ignoring 
> return value of 'write', declared with attribute warn_unused_result 
> [-Werror=unused-result]
>          write(1, msg, sizeof(msg));
>          ^
> repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c:251:9: error: ignoring 
> return value of 'write', declared with attribute warn_unused_result 
> [-Werror=unused-result]
>          write(1, msg, sizeof(msg));
>          ^
> repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c: In function 
> 'set_nonblock':
> repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c:223:9: error: ignoring 
> return value of 'write', declared with attribute warn_unused_result 
> [-Werror=unused-result]
>          write(1, msg, sizeof(msg));
>          ^
> repos/apache-mynewt-core/hw/mcu/native/src/hal_uart.c:228:9: error: ignoring 
> return value of 'write', declared with attribute warn_unused_result 
> [-Werror=unused-result]
>          write(1, msg, sizeof(msg));
>          ^
> Error: repos/apache-mynewt-core/hw/mcu/native/src/hal_system.c: In function 
> 'usage':
> repos/apache-mynewt-core/hw/mcu/native/src/hal_system.c:58:5: error: ignoring 
> return value of 'write', declared with attribute warn_unused_result 
> [-Werror=unused-result]
>      (void) write(2, msg, strlen(msg));
>      ^
> cc1: all warnings being treated as errors



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to