[LLVMdev] clang errors on void main()

Vasiliy Korchagin korchagin at ispras.ru
Wed Feb 8 05:31:10 PST 2012

07.02.2012 07:27, Eli Friedman пишет:
> On Mon, Feb 6, 2012 at 6:51 PM, Xin Tong<xerox.time.tech at gmail.com>  wrote:
>> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: allow-non-int-main-option.patch
Type: text/x-diff
Size: 6691 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120208/feff4c10/attachment.patch>

More information about the llvm-dev mailing list