File: type.yo

package info (click to toggle)
c%2B%2B-annotations 8.2.0-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 11,804 kB
  • ctags: 2,845
  • sloc: cpp: 15,418; makefile: 2,473; ansic: 165; perl: 90; sh: 29
file content (27 lines) | stat: -rw-r--r-- 1,059 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
bf(C++) uses very strict i(type checking). A prototype must be known for each
function before it is called, and the call must match the prototype.
The program
        verb(
    int main()
    {
        printf("Hello World\n");
    }
        )
 often compiles under bf(C), albeit with a warning that ti(printf()) is an
unknown function. But bf(C++) compilers (should) fail to produce code in such
cases. The error is of course caused by the missing hi(stdio.h)
 tt(#include <stdio.h>) (which in bf(C++) is more commonly included as
 hi(cstdio) tt(#include <cstdio>) directive).

    And while we're at it: as we've seen in bf(C++) ti(main) em(always) uses
the tt(int) i(return value). Although it is possible to define hi(main)tt(int
main()) without explicitly defining a return statement, within tt(main) it is
not possible to use a tt(return) statement without an explicit
tt(int)-expression.  For example:
        verb(
    int main()
    {
        return;     // won't compile: expects int expression, e.g.
                    // return 1;
    }
        )