Skip to content

Arduino compiler string warnings when Preferences set to None #6118

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

Closed
1 task done
palmerr23 opened this issue Jan 10, 2022 · 5 comments
Closed
1 task done

Arduino compiler string warnings when Preferences set to None #6118

palmerr23 opened this issue Jan 10, 2022 · 5 comments
Assignees
Labels
IDE: Arduino IDE Issue relates to Arduino IDE Status: Solved
Milestone

Comments

@palmerr23
Copy link

Board

DevkitC ESP32 WROOM

Device Description

DevkitC

Hardware Configuration

N/A

Version

latest master

IDE Name

Arduino

Operating System

Win 11

Flash frequency

80

PSRAM enabled

no

Upload speed

921600

Description

Frederic,

Even when Arduino compiler message Preferences are set to None, messages like the following appear:

warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
screenError("Bad EEPROM read\nFailed factory reset\nAborting", MY_RED, 10, false);

The message itself is not the issue (as it is correct), the problem is that it should not appear when compiler warnings are turned off.

Perhaps a compiler flag is not set correctly in the board file?

It's a minor issue, but it's annoying to have to hunt through all the warnings for an actual error!

BTW: thanks for the Arduino ESP32 implementation, it generally works pretty flawlessly.

Richard

Sketch

void screenError(char * message, uint16_t bgcol, uint16_t onTime, bool logo)

Debug Message

N/A

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@palmerr23 palmerr23 added the Status: Awaiting triage Issue is waiting for triage label Jan 10, 2022
@VojtechBartoska
Copy link
Contributor

Hello, can you please retest this on v2.0.3-rc1?

@VojtechBartoska VojtechBartoska added IDE: Arduino IDE Issue relates to Arduino IDE Resolution: Awaiting response Waiting for response of author and removed Status: Awaiting triage Issue is waiting for triage labels Apr 11, 2022
@palmerr23
Copy link
Author

Issue is still present in v2.0.3-rc1

@VojtechBartoska VojtechBartoska added Status: Needs investigation We need to do some research before taking next steps on this issue and removed Resolution: Awaiting response Waiting for response of author labels Apr 12, 2022
@PilnyTomas
Copy link
Contributor

Hi @palmerr23, could you please provide complete sketch with all the #includes and other setup necessary to replicate your issue?

@palmerr23
Copy link
Author

void setup() {
badkitty("ABC");
}
void badkitty(char * msg){
}
void loop() {
}
![prefs](https://user-images.githubusercontent.com/14856369/163073937-8d8855b4-7710-4bbe-a002-1681e30ec1df.png)

C:\Users\xyzzy.DESKTOP-J4ESB3N\Documents\arduino\sketch_apr13a\sketch_apr13a.ino: In function 'void setup()':
C:\Users\xyzzy.DESKTOP-J4ESB3N\Documents\arduino\sketch_apr13a\sketch_apr13a.ino:2:11: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
badkitty("ABC");

Arduino 1.8.19 with v2.0.3-rc1

Preferences image attached.

@VojtechBartoska VojtechBartoska moved this from Todo to Under investigation in Arduino ESP32 Core Project Roadmap Apr 13, 2022
@VojtechBartoska VojtechBartoska added Status: In Progress ⚠️ Issue is in progress and removed Status: Needs investigation We need to do some research before taking next steps on this issue labels Apr 13, 2022
@VojtechBartoska VojtechBartoska moved this from Under investigation to In Review in Arduino ESP32 Core Project Roadmap Apr 13, 2022
@VojtechBartoska VojtechBartoska added this to the 2.0.4 milestone May 5, 2022
me-no-dev pushed a commit that referenced this issue May 9, 2022
Summary

Added compiler.warning_flags to all chips in platform.txt to reflect users setting of warning level output during compilation (set up in Arduino IDE preferences)

Impact

When a warning is set to none the compilation will no longer display warnings

Related links

Solves issue #6118
@me-no-dev
Copy link
Member

Closing via #6596

Repository owner moved this from In Review to Done in Arduino ESP32 Core Project Roadmap May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IDE: Arduino IDE Issue relates to Arduino IDE Status: Solved
Projects
Development

No branches or pull requests

4 participants