[
https://issues.apache.org/jira/browse/MYNEWT-688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15946088#comment-15946088
]
ASF subversion and git services commented on MYNEWT-688:
--------------------------------------------------------
Commit efbaf05f414e4e4076334ab676c47a6f5a5235b9 in incubator-mynewt-core's
branch refs/heads/develop from [~marko]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-mynewt-core.git;h=efbaf05
]
MYNEWT-688; disabling unused-result warning when compiling hw/mcu/native,
and assigning return value from write() in os_fault.c:__assert_func().
> 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)