Skip to content

Commit 65703c3

Browse files
committed
pbsys/host: Quiet -Werror=uninitialized.
Assign values to output parameters when PBSYS_CONFIG_HOST is disabled to avoid compiler warnings.
1 parent c7e0d9a commit 65703c3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/pbio/include/pbsys/host.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ pbio_error_t pbsys_host_send_event(pbio_os_state_t *state, pbio_pybricks_event_t
4949
#define pbsys_host_stdin_set_callback(callback) { (void)(callback); }
5050
#define pbsys_host_stdin_flush()
5151
#define pbsys_host_stdin_get_available() 0
52-
#define pbsys_host_stdin_read(data, size) PBIO_ERROR_NOT_SUPPORTED
53-
#define pbsys_host_stdout_write(data, size) { (void)(data); (void)(size); PBIO_ERROR_NOT_SUPPORTED; }
52+
#define pbsys_host_stdin_read(data, size) ({ *(data) = 0; *(size) = 0; PBIO_ERROR_NOT_SUPPORTED; })
53+
#define pbsys_host_stdout_write(data, size) ({ *(size) = 0; PBIO_ERROR_NOT_SUPPORTED; })
5454
#define pbsys_host_tx_is_idle() false
5555

5656
static inline pbio_error_t pbsys_host_send_event(pbio_os_state_t *state, pbio_pybricks_event_t event_type, const uint8_t *data, size_t size) {

0 commit comments

Comments
 (0)