Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZubaxGNSS compilation broken on autotest #13728

Closed
peterbarker opened this issue Mar 5, 2020 · 1 comment · Fixed by #13774
Closed

ZubaxGNSS compilation broken on autotest #13728

peterbarker opened this issue Mar 5, 2020 · 1 comment · Fixed by #13774

Comments

@peterbarker
Copy link
Contributor

Bug report

BB-WAF: In file included from /mnt/volume_nyc3_01/autotest/APM/APM/libraries/AP_Baro/AP_Baro.h:4:0,
BB-WAF:                  from /mnt/volume_nyc3_01/autotest/APM/APM/libraries/AP_Vehicle/AP_Vehicle.h:24,
BB-WAF:                  from /mnt/volume_nyc3_01/autotest/APM/APM/libraries/AP_Compass/AP_Compass.cpp:5:
BB-WAF: /mnt/volume_nyc3_01/autotest/APM/APM/libraries/AP_Compass/AP_Compass.cpp:247:67: error: index 2 denotes an offset greater than size of 'const Compass::mag_state [2]' [-Werror=array-bounds]
BB-WAF:      AP_GROUPINFO("OFS3",    13, Compass, _state._priv_instance[2].offset, 0),
BB-WAF:                                                                    ^
BB-WAF: /mnt/volume_nyc3_01/autotest/APM/APM/libraries/AP_Param/AP_Param.h:94:71: note: in definition of macro 'AP_VAROFFSET'
BB-WAF:  #define AP_VAROFFSET(type, element) (((ptrdiff_t)(&((const type *)1)->element))-1)
BB-WAF:                                                                        ^~~~~~~
BB-WAF: /mnt/volume_nyc3_01/autotest/APM/APM/libraries/AP_Param/AP_Param.h:109:54: note: in expansion of macro 'AP_GROUPINFO_FLAGS'
BB-WAF:  #define AP_GROUPINFO(name, idx, clazz, element, def) AP_GROUPINFO_FLAGS(name, idx, clazz, element, def, 0)
BB-WAF:                                                       ^~~~~~~~~~~~~~~~~~
BB-WAF: /mnt/volume_nyc3_01/autotest/APM/APM/libraries/AP_Compass/AP_Compass.cpp:247:5: note: in expansion of macro 'AP_GROUPINFO'
BB-WAF:      AP_GROUPINFO("OFS3",    13, Compass, _state._priv_instance[2].offset, 0),
BB-WAF:      ^
BB-WAF: compilation terminated due to -Wfatal-errors.
BB-WAF: cc1plus: some warnings being treated as errors
BB-WAF: 
BB-WAF: Waf: Leaving directory `/home/autotest/build/tmp/binaries.build/ZubaxGNSS'
BB-WAF: Build failed
BB-WAF:  -> task in 'objs/AP_Compass' failed (exit status 1):
BB-WAF: 	{task 139682387568112: cxx AP_Compass.cpp -> AP_Compass.cpp.0.o}
BB-WAF:  (run with -v to display more information)
BB: Process failed ((11327, 256))
BB: Failed build of AP_Periph ZubaxGNSS latest

Issue details

Compilation appears to be broken with a bounds-sanity check.

Version
master (autotest server)

Platform
[ ] All
[ ] AntennaTracker
[ ] Copter
[ ] Plane
[ ] Rover
[ ] Submarine
[ X ] AP_Periph

Airframe type
Erp.

Hardware type
ZubaxGNSS

Logs
autotest build log: https://autotest.ardupilot.org/autotest-output.txt

@tridge @bugobliterator

@peterbarker
Copy link
Contributor Author

This looks to be confusion between COMPASS_MAX_INSTANCES and HAL_COMPASS_MAX_SENSORS

I propose eliminating the use of HAL_COMPASS_MAX_SENSORS anywhere but when determining what COMPASS_MAX_INSTANCES should be set to (currently switches on whether we're doing an AP_Periph build, and the ZubaxGNSS AP_Periph isn't setting HAL_COMPASS_MAX_SENSORS to 1, so the two #defines are getting out of whack.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants