Skip to content

Fix for "only initialized variables can be placed into program memory area" warning #1793

Closed
@Lauszus

Description

@Lauszus

As discussed on the developer mailing list: https://groups.google.com/a/arduino.cc/forum/#!msg/developers/5iaId6nPzqA/jpgd38UdBqQJ.

Here is how I got rid of the incorrect "only initialized variables can be placed into program memory area" warning: https://github.com/felis/USB_Host_Shield_2.0/blob/f676812f84b3212779365b9950927a01209e4045/settings.h#L82-L96. This was done for the USB Host library, but could easily be used in the Arduino core as well.

See: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34734.
The fixed is based on the following comment: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34734#c4.

I have tested it myself on my local copy of the Arduino IDE and it works fine. I can send a pull request for that if you like?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: CoreRelated to the code for the standard Arduino APIComponent: ToolchainThe tools used for compilation and uploading to Arduino boards

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions