Skip to content

Fix _SFR_IO8 macro to avoid "cannot take the address of an rvalue" #187

Closed
@ianfixes

Description

@ianfixes

Issue Summary

see Arduino-CI/SD#2

error: cannot take the address of an rvalue of type 'int'
  {&DDRE, &PINE, &PORTE, 0},  // E0  0
   ^~~~~

Working theory is that this is caused by a badly formed macro.

https://github.com/Arduino-CI/arduino_ci/blob/master/cpp/arduino/avr/io.h#L99

- #define _SFR_IO8(io_addr) (io_addr) // this macro is all we need from the sfr file 
+ #define _MMIO_BYTE(mem_addr) (*(volatile uint8_t *)(mem_addr))
+ #define _SFR_IO8(io_addr) _MMIO_BYTE((io_addr) + __SFR_OFFSET)

Will see if volatile is sufficient to fix

Metadata

Metadata

Assignees

No one assigned

    Labels

    arduino mocksCompilation mocks for the Arduino librarybugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions