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

Review ESP32 compiler options to enable warnings as errors #754

Merged
merged 5 commits into from
Jun 20, 2018
Merged

Review ESP32 compiler options to enable warnings as errors #754

merged 5 commits into from
Jun 20, 2018

Conversation

MatthiasJentsch
Copy link
Contributor

@MatthiasJentsch MatthiasJentsch commented Jun 20, 2018

Description

Added the compiler options -Wall -Wextra -Werror and removed all the -Wno-error... options for the ESP32 target.

Motivation and Context

How Has This Been Tested?

With the changes the ESP32 target compiles without errors

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Signed-off-by: Matthias Jentsch [email protected]

@nfbot
Copy link
Member

nfbot commented Jun 20, 2018

Hi @MatthiasJentsch,

I'm nanoFramework bot.
Thank you for your contribution!

A human will be reviewing it shortly. 😉

@@ -226,6 +226,7 @@ int CLR_Debug::PrintfV( const char *format, va_list arg )
size_t iBuffer = MAXSTRLEN(buffer);

bool fRes = CLR_SafeSprintfV( szBuffer, iBuffer, format, arg );
(void)fRes;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is still required after the PR with the missing ESP32 defines?! ASSERT should be available after that...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. That's not needed anymore. I've corrected that.

@@ -117,8 +116,8 @@ HRESULT Library_win_dev_pwm_native_Windows_Devices_Pwm_PwmPin::NativeInit___VOID
// get a pointer to the managed object instance and check that it's not NULL
CLR_RT_HeapBlock* pThis = stack.This(); FAULT_ON_NULL(pThis);

int timerId = (int)(pThis[ FIELD___pwmTimer ].NumericByRef().u4);
PwmPulsePolarity polarity = (PwmPulsePolarity)(pThis[ FIELD___polarity ].NumericByRef().u4);
//int timerId = (int)(pThis[ FIELD___pwmTimer ].NumericByRef().u4);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not required at all? if not better remove it instead of commenting

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove it

@@ -131,7 +130,7 @@ HRESULT Library_win_dev_pwm_native_Windows_Devices_Pwm_PwmPin::NativeInit___VOID
NANOCLR_CHECK_HRESULT( ConfigureAndStart(pThis, true, true) );

// Get speed mode based on Timer used
ledc_mode_t speed_mode = GetSpeedMode(timerId);
//ledc_mode_t speed_mode = GetSpeedMode(timerId);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove it

@@ -348,7 +355,7 @@ HRESULT Library_win_dev_serial_native_Windows_Devices_SerialCommunication_Serial
uart_port_t uart_num = (uart_port_t)(pThis[ FIELD___portIndex ].NumericByRef().s4 - 1);

// Wait for 1 sec for data to be sent
esp_err_t esp_err = uart_wait_tx_done( uart_num, (TickType_t) 1000 / portTICK_PERIOD_MS);
/*esp_err_t esp_err =*/ uart_wait_tx_done( uart_num, (TickType_t) 1000 / portTICK_PERIOD_MS);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't better to check for the return?
if not, better remove this too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll check the return value

@@ -11,30 +11,30 @@ HRESULT Library_win_dev_spi_native_Windows_Devices_Spi_SpiBusInfo::get_MaxClockF
{
NANOCLR_HEADER();
{
CLR_RT_HeapBlock* pArg = &(stack.Arg1());
//CLR_RT_HeapBlock* pArg = &(stack.Arg1());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove the unnecessary code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove the code

}

HRESULT Library_win_dev_spi_native_Windows_Devices_Spi_SpiBusInfo::get_MinClockFrequency___I4( CLR_RT_StackFrame& stack )
{
NANOCLR_HEADER();
{
CLR_RT_HeapBlock* pArg = &(stack.Arg1());
//CLR_RT_HeapBlock* pArg = &(stack.Arg1());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove the code

@@ -335,7 +337,7 @@ HRESULT Library_win_dev_spi_native_Windows_Devices_Spi_SpiDevice::NativeInit___V
{
NANOCLR_HEADER();

spi_device_interface_config_t dev_config;
//spi_device_interface_config_t dev_config;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove the code

@@ -13,7 +13,7 @@ extern bool CLR_Messaging_ProcessPayload(WP_Message* msg);


// Initialize to a packet sequence number impossible to encounter
static uint32_t lastPacketSequence = 0x00FEFFFF;
//static uint32_t lastPacketSequence = 0x00FEFFFF;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this shouldn't be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what to do here.

Copy link
Member

@josesimoes josesimoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@josesimoes josesimoes added Type: enhancement Area: Interpreter Everything related with the interpreter, execution engine and such Series: ESP32 Everything related specifically with ESP32 series targets Area: Common libs Everything related with common libraries labels Jun 20, 2018
@josesimoes josesimoes merged commit ba1991a into nanoframework:develop Jun 20, 2018
@MatthiasJentsch MatthiasJentsch deleted the warnAsError branch June 21, 2018 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Common libs Everything related with common libraries Area: Interpreter Everything related with the interpreter, execution engine and such Series: ESP32 Everything related specifically with ESP32 series targets Type: enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Review ESP32 compiler options to enable warnings as errors
3 participants