📄 voidmain.jr2.html
字号:
<html><!-- Mirrored from c-faq.com/ansi/voidmain.jr2.html by HTTrack Website Copier/3.x [XR&CO'2008], Sat, 14 Mar 2009 08:02:59 GMT --><head></head><body>From: The Amorphous Mass <robinson@blue.weeg.uiowa.edu><br>To: scs@eskimo.com<br>Date: Mon, 18 Dec 1995 16:40:20 -0600 (CST)<br>Subject: void main(void) crashes PC<br>Message-ID: <Pine.A32.3.91.951218160207.26209A-100000@black.weeg.uiowa.edu><p>Hi Steve,<p>Sorry this took so long; it's been really crazy around here. The machine that crashed is a Toshiba Satellite T2400CT with a 486/66 running Windows 3.1.1. The compiler is Borland C++ 4.0, installed to run strict ANSI C. The symptom is simple: you compile the program, and run it, and you get a syntax error -- from the <em>linker</em>! Changing <TT>void</TT> to <TT>int</TT>dispels the problem immediately. Of course, since apparently Borland defaults to strict ANSI compliance (my coworker did not specify strict ANSI mode) there is no way to run most of Borland's own example code without reinstalling the compiler...<p>This isn't quite as exciting as I originally thought it was, but it's a beautiful example of undefined behavior on the platform where void main() is "supposed" to be "good style," using one of the compilers that advocates that style.<p>Hope this is worth something. I was kind of hoping that it actually hung the machine like my colleague let on, but a linker syntax error is a pretty satisfying crash. :)<p><pre>___________Bushido, n.: the ancient art of keeping your | James Robinsoncool when a US President ralphs in your lap. | james-f-robinson@uiowa.edu</pre></body><!-- Mirrored from c-faq.com/ansi/voidmain.jr2.html by HTTrack Website Copier/3.x [XR&CO'2008], Sat, 14 Mar 2009 08:02:59 GMT --></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -