clang errors on void main()

Is there any way to stop this ?

/home/socrates/llvm/llvm-3.0.src/benchmarks/powerstone/crc/crc.c:67:1:
error: 'main' must return 'int'
void main()
^
1 error generated.

Thanks

You mean besides fixing the source of your benchmark so it's valid C?
Not at the moment... patches welcome.

-Eli

07.02.2012 07:27, Eli Friedman пишет:

Is there any way to stop this ?

/home/socrates/llvm/llvm-3.0.src/benchmarks/powerstone/crc/crc.c:67:1:
error: 'main' must return 'int'
void main()
^
1 error generated.

You mean besides fixing the source of your benchmark so it's valid C?
Not at the moment... patches welcome.

-Eli

We suggest patch for allowing main() function to have non-integer return type. This feature can be enabled with "-allow-non-int-main" option. In this case warning about incorrect main() return type will be printed instead of error.

In patch also included test case for this feature.

Vasiliy Korchagin,
The Institute for System Programming of the Russian Academy of Sciences

allow-non-int-main-option.patch (6.53 KB)

Hi Vasiliy,

Please send clang patches to cfe-dev.

-Chris