llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27.95k stars 11.53k forks source link

llvm-19.1.0-rc3 build error #106549

Open davide-q opened 2 weeks ago

davide-q commented 2 weeks ago
llvm/tools/llvm-isel-fuzzer/llvm-isel-fuzzer.cpp:141:45: warning: ISO C++ forbids zero-size array 'argv' [-Wpedantic]

ExitOnError ExitOnErr(std::string(*argv[0]) + ": error:"); ___^

(I manually replaced spaces with underscores, to have the caret to correctly point to the error)

alexrp commented 2 weeks ago

This looks like a warning, not an error? (And a bogus one at that?)

This line, OTOH, looks a bit suspect compared to the rest:

https://github.com/llvm/llvm-project/blob/4bc7c74240b6f13bf421c1fef0155370b23d9fc8/llvm/tools/llvm-isel-fuzzer/llvm-isel-fuzzer.cpp#L138

davide-q commented 2 weeks ago

@alexrp of course you are correct, I got confused by the fact that the warning was about a line which invoked ExitOnError and that my build failed for other 2 reasons (including the one mentioned in the other issue I mentioned earlier).

That said, if one adds -Wpedantic to the build line, then those rules should be followed, otherwise it just makes the output long unnecessarily verbose, no?

alexrp commented 2 weeks ago

Yeah, I mean, ideally there should be zero warnings. But what often happens in large code bases like LLVM is that warnings slip through because you have people compiling the project with an almost incomprehensible number of different compilers (type, version, host machine, target machine, ...). Also, in this particular case, it just looks like an odd compiler bug; there's no array declaration there.