Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ba0c41b

Browse files
committedJul 25, 2016
Added -fpermissive flag.
This avoid build errors on old libraries. It may possibly be removed in the future after a period of transition.
1 parent e307987 commit ba0c41b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎hardware/arduino/avr/platform.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ compiler.c.elf.flags={compiler.warning_flags} -Os -Wl,--gc-sections
2525
compiler.c.elf.cmd=avr-gcc
2626
compiler.S.flags=-c -g -x assembler-with-cpp
2727
compiler.cpp.cmd=avr-g++
28-
compiler.cpp.flags=-c -g -Os {compiler.warning_flags} -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD
28+
compiler.cpp.flags=-c -g -Os {compiler.warning_flags} -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD
2929
compiler.ar.cmd=avr-ar
3030
compiler.ar.flags=rcs
3131
compiler.objcopy.cmd=avr-objcopy

3 commit comments

Comments
 (3)

macegr commented on Oct 17, 2016

@macegr

This was not a good thing to do. It opens the door for some very sneaky bugs. For example, it stops throwing an error when a pointer is cast to a non-pointer type.

cmaglie commented on Oct 17, 2016

@cmaglie
MemberAuthor

The reason for this has already been discussed here and following comments.

macegr commented on Oct 17, 2016

@macegr

The comment was sparked by this discussion: https://www.reddit.com/r/arduino/comments/57h8j1/invalid_conversion_from_unsigned_char_to_int/

The Arduino IDE currently defaults to show NO compiler warnings. It is unrealistic to assume that any incorrectly-written libraries will be corrected as long as the IDE silently hides these problems. New Arduino builds have broken existing libraries since time immemorial and they will get fixed. But not while the errors are hidden, as well as the warnings.

Here is where the default compiler warning level is set to none:

String currentWarningLevel = PreferencesData.get("compiler.warning_level", "none");

Please sign in to comment.