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
Merged

Reorder HardwareSerial initialisation list to fix compiler warnings #1835

merged 1 commit into from Jan 29, 2014

Conversation

@ribbons
Copy link

@ribbons ribbons 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
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
Copy link
Collaborator

@matthijskooijman matthijskooijman 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 issue Jan 29, 2014
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 hardwareserial-warning branch Feb 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants