PX4-windows-toolchain icon indicating copy to clipboard operation
PX4-windows-toolchain copied to clipboard

Can't compile PX4 v1.9.2 under v0.9

Open bys1123 opened this issue 4 years ago • 7 comments

Got error:

In file included from ../../src/lib/mixer/mixer_load.c:42:
../../src/lib/mixer/mixer_load.c: 在函数‘load_mixer_file’中:
../../src/lib/mixer/mixer_load.c:72:42: warning: Array subscript has type ‘char’ [-Wchar-subscripts]
   72 |   if ((strlen(line) < 2) || !isupper(line[0]) || (line[1] != ':')) {
      |                                      ~~~~^~~

bys1123 avatar Apr 06 '20 19:04 bys1123

I tried update arm gcc to 7-2018-q2-update on ubuntu, but on ubuntu has no problem. And I run make distclean lots of times, still can't work.

bys1123 avatar Apr 06 '20 22:04 bys1123

I guess this is caused by in ubuntu gcc version is 7.5.0, but cygwin is 9.3.0

-- The CXX compiler identification is GNU 9.3.0
-- The C compiler identification is GNU 9.3.0

bys1123 avatar Apr 07 '20 11:04 bys1123

Hi I have news. I reached nothing with v1.10.2. But I think I have something with v1.11.0-beta1.

git checkout v1.11.0-beta1 make px4_sitl_default none_iris

then it will ask for updates toolchain2

I pressed u, then git submodule update --init --recursive Then I pressed several times u untill

toolchain3 toochain4 toochain5

johan606303 avatar Apr 21 '20 13:04 johan606303

In my experience, run git submodule update --init --recursive first, then don't need to press u anymore.

bys1123 avatar Apr 21 '20 18:04 bys1123

It's not the case on my computer. Does it work well for you ?

johan606303 avatar May 01 '20 13:05 johan606303

warning: Array subscript has type ‘char’ [-Wchar-subscripts]

This is a compiler warning. Can you try if you can compile it by disabling -Werror here: https://github.com/PX4/Firmware/blob/960ad0693f3ff13c391bd8ddda61fd15dfe22ae0/cmake/px4_add_common_flags.cmake#L71

julianoes avatar May 04 '20 06:05 julianoes

warning: Array subscript has type ‘char’ [-Wchar-subscripts]

This is a compiler warning. Can you try if you can compile it by disabling -Werror here: https://github.com/PX4/Firmware/blob/960ad0693f3ff13c391bd8ddda61fd15dfe22ae0/cmake/px4_add_common_flags.cmake#L71

This worked for me, but it's really odd - I feel like line[0] is very clearly using 0 to index into the array, which shouldn't be considered a char in any circumstance. Maybe my c/c++ knowledge is shaky...

mdermksian avatar Oct 30 '20 01:10 mdermksian