How to tell the plugin to do the staic analyzing using 32bit mode?
I am writing the codes for one 32bit platform. But the plugin keeps telling me something like this "cast to uint8_t* from smaller integer type uint32_t." when I do some explicit casting, which is not a problem on my 32bit platform.
How can I prevent this annoying message?
I tried to add argument "-m32" in c_flags, but not works.
Sorry about my poor issue format, sent via my cellphone.
Hm. Strange. I may look into this at some point. It seems to be valid as pointer on your system should be 32 bit long. On the separate note, are you really sure converting an integer to a pointer is a good thing?
@niosus
- The software I am using, like OS, sublime and clang are all 64bit. So I think it is pretty normal if clang gives me some warning like that, I guess it thinks I was developing for x64 platform.
- The platform I am developing for is an embedded system, it is very commnon doing the casting for address. Besides, a lot of APIs provided by chip company is designed this way in which I have to do lots of casting.
Ok, makes sense. I will try to research which flag should be added and if it actually works adding it whenever I have the time.
@niosus Thank you very much.
try adding to flags: -target i386-none-linux-gnueabi
@simia thanks. @niosus As I am using Windows, so I tried -target i686-pc-windows-msvc. but it makes my system not responding any more, I can only manually power off and on.
Strange...
@simia @niosus There is one time that the editor didn't break my system, I found that my original problem still exists.
That's really odd as -m flag seems to work: https://godbolt.org/g/8DE93n
Are you compiling c or c++?
@simia C code. Maybe using clang as a static analyzing tool needs an argument other than -m32?
m32 option works fine on my pc but I am running linux not windows. Not sure if there is any difference.
(Yellow outline is not from ECC, ECC generates green ones)

@simia Thank you! Your screenshot reminds me! I used to write "-std=c11 -m32" for the c_flags parameter. I just have to break it up as you did, and it works!
@niosus The problem is solved.
Great to hear that!