Skip to content

Fix input string const-ness to avoid warnings with literal strings #336

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

Merged
merged 1 commit into from
Sep 23, 2018

Conversation

ppescher
Copy link
Contributor

I guess nobody at Arduino ever bothers to compile with full warnings enabled, which in fact is not the default compiler setting.

@fpistm fpistm self-requested a review September 21, 2018 16:19
@fpistm
Copy link
Member

fpistm commented Sep 22, 2018

Hi @ppescher and thanks for your contribution
I always build with all warnings enabled and try to remove all related to core.
I do not fix HAL/LL which should be fixed across new HAL/LL release.
I never see warning about this class.
Please, could you share an example which rise those warnings?

@ppescher
Copy link
Contributor Author

Hi Frederic,

I know you do, because the build output of the STM32 core is very clean compared to other Arduino cores. I remember that was a pleasant surprise on my first build.

I know this code comes from various sources and contributions, so I do not expect the same quality everywhere. This is just my small contribution to make it a bit better.

My complaint was about the decision to turn all warnings off by default in the Arduino IDE. But this is not the place to argue about that.

One example of code that triggers a warning is as simple as:

Serial.find("pippo");

With avr-gcc (AVR core) the output message is:

warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

With arm-none-eabi-gcc (STM32 core) the message is:

warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

@fpistm fpistm merged commit 32e92d3 into stm32duino:master Sep 23, 2018
@ppescher ppescher deleted the devel branch September 23, 2018 19:32
benwaffle pushed a commit to benwaffle/Arduino_Core_STM32 that referenced this pull request Apr 10, 2019
Fix input string const-ness to avoid warnings with literal strings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants