Static function inside namepsace : compile on UNO not on DUE

nitrof:
Is it a risky trick to do to change the compiler like this ?

It's risky in that the new compiler version hasn't been thoroughly tested. All users of the MKR Vidor 5000 board have been using this compiler version for over 6 months now and I haven't heard of any reports of problems. They also have beta testers using the same GCC version on the AVR for the last 3.5 months with no reported issues there. So the main concern would be that there hasn't been any testing at all of this compiler version with the Due's code.

Arduino tends to be pretty conservative about updating the compiler, since for the average Arduino user the most important thing is that they have an easy learning experience, rather than the best performance and the shiny new advanced C++ features. It's easy enough for a more advanced user like you to undo the change and go back to the old compiler version, but unleashing a problematic compiler on hundreds of thousands of beginners is a real disaster.

Another concern is the change I instructed you to make to line 81. I don't actually know what that -gcc flag I had you remove did. I only know that it's not supported in the newer compiler version. It would be best to do some research to find out why it was there and see if it needs to be replaced with some other flags. It might make sense to look at what the differences are between the Arduino SAM Boards platform.txt and the Arduino SAMD Beta Boards platform.txt (which you can find at packages/arduino/hardware/samd_beta/1.6.25/platform.txt).

If nothing else, it's kind of fun to mess around with the inner workings off the Arduino IDE a bit, and hopefully learn something along the way.

nitrof:
could it be change for good for the DUE ?

Yes, the 4.8.3 compiler version they're currently using is quite old and there are a lot of requests for Arduino to update it. We've been on avr-gcc 5.4.0 for a while now, though 5.4.0 actually has some bugs that are hopefully accelerating the update to 7.3.0. I suspect Arduino will update Arduino SAM Boards on the next release after they have done so for Arduino SAMD Boards. Unfortunately, development is not very active on Arduino SAM Boards so I don't know how long it would take them to do the next release.

nitrof:
Taht make my code not portable

Very good point!

nitrof:
Thanks a lot.

You're welcome. I'm glad if I was able to be of assistance. Enjoy!
Per