1

I'm cross compiling a project for various architectures and OS. Two of them are Android with arm-linux-androideabi-4.9 and Raspbian with arm-linux-gnueabihf-gcc(4.8.3).

My code has a dependency on the Ne10 project which does some arithmetic on void pointers.

I'm compiling with -Wpedantic and -Wno-pointer-arith for the two toolchains however, the Android one compiles fine but the Raspbian one still shows some warning about the void pointer arithmetic.

error: pointer of type 'void *' used in arithmetic [-Werror=pedantic]

I know the warning/error could be removed by removing -Wpedantic but that's not an option for me.

I am wondering if the issue could come from the difference between the version numbers but the doc of both are the same about the void arithmetic.

Any ideas ?

Damien
  • 164
  • 11
  • 1
    Alternate way: Fix the code to not use non-standard extension and submit patch. – user694733 Jan 21 '19 at 11:46
  • In yor make file do not use `-Wpedantic` to compile `NE10` – 0___________ Jan 21 '19 at 12:09
  • @user694733 Thank you for your advice, I'm looking at it. – Damien Jan 21 '19 at 12:14
  • @P__J__ I am using CMake, this could be an option too, to just remove it for Ne10 – Damien Jan 21 '19 at 12:15
  • 1
    I did some trial & error and it seems that `-Wno-pointer-arith` in combination with `-pedantic` only works well from 4.9.0 and beyond. Poke at the changes made in that version. – Lundin Jan 21 '19 at 14:30
  • Thanks @Lundin, that confirms my thoughts about the issue being fixed between these two versions. If you want to post this as an answer, I'd be happy to mark it as solution for my post =) – Damien Jan 21 '19 at 15:44
  • @Damien I couldn't find any official source, the gcc change log is broad and quite poorly written. I guess we'd have to dig through the version control but that's too much work for me. – Lundin Jan 22 '19 at 07:28

0 Answers0