Closed
Description
The command bundle exec arduino_ci_remote.rb --skip-unittests
shows that all the examples compile fine in the Arduino IDE. But when I run bundle exec arduino_ci_remote.rb --skip-compilation
I get error: cannot take the address of an rvalue of type 'int'
(see below).
DDRE
comes from #define DDRE _SFR_IO8(0x0D)
which uses #define _SFR_IO8(io_addr) (io_addr)
. So, it appears that the code is trying to do something like
volatile uint8_t* ddr = &0x0D;
,
which does seem odd. Perhaps 0x0D is supposed to be an address?
@ianfixes, @per1234, do you have any advice?
Note that this is where I ran into #186.
Last command: $ g++ -std=c++0x -o /Users/jfoster/Documents/Arduino/libraries/SD/unittest_test.cpp.bin -DARDUINO=100 -g -O1 -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize=address -D__AVR_ATmega2560__ -DARDUINO_CI -D__AVR__ -I/Users/jfoster/Documents/Arduino/libraries/SD/vendor/bundle/ruby/2.6.0/gems/arduino_ci-0.3.0/cpp/arduino -I/Users/jfoster/Documents/Arduino/libraries/SD/vendor/bundle/ruby/2.6.0/gems/arduino_ci-0.3.0/cpp/unittest -I/Users/jfoster/Documents/Arduino/libraries/SD/src -I/Users/jfoster/Documents/Arduino/libraries/SD/src/utility /Users/jfoster/Documents/Arduino/libraries/SD/vendor/bundle/ruby/2.6.0/gems/arduino_ci-0.3.0/cpp/arduino/Arduino.cpp /Users/jfoster/Documents/Arduino/libraries/SD/vendor/bundle/ruby/2.6.0/gems/arduino_ci-0.3.0/cpp/arduino/Godmode.cpp /Users/jfoster/Documents/Arduino/libraries/SD/vendor/bundle/ruby/2.6.0/gems/arduino_ci-0.3.0/cpp/arduino/stdlib.cpp /Users/jfoster/Documents/Arduino/libraries/SD/vendor/bundle/ruby/2.6.0/gems/arduino_ci-0.3.0/cpp/unittest/ArduinoUnitTests.cpp /Users/jfoster/Documents/Arduino/libraries/SD/src/File.cpp /Users/jfoster/Documents/Arduino/libraries/SD/src/SD.cpp /Users/jfoster/Documents/Arduino/libraries/SD/src/utility/Sd2Card.cpp /Users/jfoster/Documents/Arduino/libraries/SD/src/utility/SdFile.cpp /Users/jfoster/Documents/Arduino/libraries/SD/src/utility/SdVolume.cpp /Users/jfoster/Documents/Arduino/libraries/SD/test/test.cpp
In file included from /Users/jfoster/Documents/Arduino/libraries/SD/src/File.cpp:15:
In file included from /Users/jfoster/Documents/Arduino/libraries/SD/src/SD.h:20:
In file included from /Users/jfoster/Documents/Arduino/libraries/SD/src/utility/SdFat.h:29:
In file included from /Users/jfoster/Documents/Arduino/libraries/SD/src/utility/Sd2Card.h:26:
/Users/jfoster/Documents/Arduino/libraries/SD/src/utility/Sd2PinMap.h:78:4: error: cannot take the address of an rvalue of type 'int'
{&DDRE, &PINE, &PORTE, 0}, // E0 0
^~~~~
Activity
Now able to compile in Arduino CI. Workaround for #2 (but see Arduino…
jgfoster commentedon Oct 25, 2020
I think this may be related to Arduino CI #120. I've been able to work around the problem with some code proposed there.
ianfixes commentedon Oct 26, 2020
Looks like fun. The bug in my code is likely here: https://github.com/Arduino-CI/arduino_ci/blob/master/cpp/arduino/avr/io.h#L99
DDRE
points to this macro in various board definitions:Which results in my implementation produces this nonsense for
&DDRE
:&(0x0D)
.According to this forum post that should really be based on these 2 macros:
So my initial thought is that this can be fixed with some type of cast, possibly involving a reference to a statically-allocated array. I'll have to think more about that, and definitely add a unit test to prevent regressing it.
ianfixes commentedon Oct 27, 2020
Just to be clear here, was this issue supposed to be opened against SD and not
arduino_ci
?jgfoster commentedon Oct 27, 2020
I started here because I wasn't sure where the problem was and because I thought that even if the problem was in
arduino_ci
I would need to implement a work-around. So, maybe this should stay open to track the fix in the framework so I can remove my "hack".jgfoster commentedon Nov 27, 2020
Seems to be working fine with 0.4.0.