|
32 | 32 | will be judged by other people by the way your source code looks. |
33 | 33 | Always try to write beautiful code. |
34 | 34 |
|
35 | | -</p><p>There are a few possible good C styles. We recommend one that is |
36 | | -well documented and comes with a Perl script for checking. The script |
37 | | -does not catch everything but is pretty good. |
| 35 | +</p><p>There are a few possible good C styles. We recommend one that is well |
| 36 | +documented and comes with a Perl script for checking. The script does not catch |
| 37 | +everything but is good enough. However, in order to use it propertly, <b>you |
| 38 | +need to start with following the C style after reading the document below, then |
| 39 | +check the resulting code with the script.</b> It will not work well if you |
| 40 | +start with non-conforming code and keep fixing the warnings until the script no |
| 41 | +longer reports anything. In that case, the resulting code may still be pretty |
| 42 | +bad style-wise. |
38 | 43 |
|
39 | 44 | </p><p>The <b>recommended C style is used for the Oracle Solaris operating |
40 | | -system source code</b> and is explained in a short (~20 pages) nicely |
41 | | -formatted document: <a href="http://mff.devnull.cz/cstyle/cstyle.ms.pdf">C Style and Coding |
42 | | -Standards for SunOS</a>. |
| 45 | +system source code</b> and is explained in a short (~20 pages) nicely formatted |
| 46 | +document: <a href="http://mff.devnull.cz/cstyle/cstyle.ms.pdf">C Style and |
| 47 | +Coding Standards for SunOS</a>. |
43 | 48 |
|
44 | | -</p><p>The <a href="http://mff.devnull.cz/cstyle/cstyle.pl">cstyle.pl</a> for verification is provided, |
45 | | -and it works like this: |
| 49 | +</p><p>The <a href="http://mff.devnull.cz/cstyle/cstyle.pl">cstyle.pl</a> for |
| 50 | +verification is provided, and it works like this: |
46 | 51 |
|
47 | 52 | </p><pre>$ chmod u+x cstyle.pl |
48 | 53 | $ ./cstyle.pl src/exams/parallel-udp/*.c |
|
0 commit comments