Skip to content

Commit a6d185d

Browse files
author
Janne Kiiskila
committed
SerialBase.h|cpp [-Wreorder] compiler warning fix
The initialization order was not quite right, so aligning the .cpp to match order .h. This hixes the following compiler warning: ``` [Warning] SerialBase.h@351,22: 'mbed::SerialBase::_flow2' will be initialized after [-Wreorder] [Warning] SerialBase.h@343,22: 'bool mbed::SerialBase::_rx_enabled' [-Wreorder] [Warning] SerialBase.cpp@26,1: when initialized here [-Wreorder] ```
1 parent 0d26be4 commit a6d185d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/source/SerialBase.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ SerialBase::SerialBase(PinName tx, PinName rx, int baud) :
3232
#endif
3333
_serial(),
3434
_baud(baud),
35+
_rx_enabled(true),
36+
_tx_enabled(true),
37+
_tx_pin(tx),
38+
_rx_pin(rx),
3539
#if DEVICE_SERIAL_FC
3640
_flow_type(Disabled),
3741
_flow1(NC),
38-
_flow2(NC),
42+
_flow2(NC)
3943
#endif
40-
_rx_enabled(true),
41-
_tx_enabled(true),
42-
_tx_pin(tx),
43-
_rx_pin(rx)
4444
{
4545
// No lock needed in the constructor
4646

0 commit comments

Comments
 (0)