Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorder HardwareSerial initialisation list to fix compiler warnings #1835

Merged
merged 1 commit into from Jan 29, 2014

Conversation

3 participants
@ribbons
Copy link

commented Jan 29, 2014

Switch the tx and rx buffer head/tail entries in the HardwareSerial initialisation list so that they match the order the fields are defined in.

This fixes the following compiler warning (repeated for each of the HardwareSerial*.cpp source files the header is used in) introduced as part of the improvements in #1711:

In file included from HardwareSerial.cpp:31:
HardwareSerial.h: In constructor 'HardwareSerial::HardwareSerial(volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*)':
HardwareSerial.h:81: warning: 'HardwareSerial::_tx_buffer_tail' will be initialized after
HardwareSerial.h:78: warning:   'volatile uint8_t HardwareSerial::_rx_buffer_head'
HardwareSerial_private.h:62: warning:   when initialized here
Reorder HardwareSerial init to fix compiler warn
Switch the tx and rx buffer head/tail entries in the HardwareSerial
initialisation list so that they match the order the fields are defined
in. This fixes a compiler warning (repeated for each of the
HardwareSerial source files the header is used in).
@matthijskooijman

This comment has been minimized.

Copy link
Collaborator

commented Jan 29, 2014

Fix looks good to me! I guess I didn't have compiler warnings enabled yet when I wrote that code :-)

cmaglie added a commit that referenced this pull request Jan 29, 2014

Merge pull request #1835 from ribbons/hardwareserial-warning
Reorder HardwareSerial initialisation list to fix compiler warnings

@cmaglie cmaglie merged commit 5cf8671 into arduino:ide-1.5.x Jan 29, 2014

@ribbons ribbons deleted the ribbons:hardwareserial-warning branch Feb 1, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.