PX4 / PX4-windows-toolchain

Repo containing all scripts to install and use the PX4 Toolchain for Windows.
BSD 3-Clause "New" or "Revised" License
31 stars 100 forks source link

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

Open bys1123 opened 4 years ago

bys1123 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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
johan606303 commented 4 years ago

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

bys1123 commented 4 years ago

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

johan606303 commented 4 years ago

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

julianoes commented 4 years ago
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

mdermksian commented 3 years ago
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...