mirror of
https://gitlab.com/fbb-git/cppannotations
synced 2024-11-16 07:48:44 +01:00
6881bc3814
Annotations. The branches and tags directory are empty, since I couldn't svnadmin import a repostitory dump. Many earlier versions exist, though, and if you want the full archive, just let me know and I'll send you the svnadmin dump of my full C++ Annotations archive. Frank B. Brokken <f.b.brokken@rug.nl> git-svn-id: https://cppannotations.svn.sourceforge.net/svnroot/cppannotations/trunk@3 f6dd340e-d3f9-0310-b409-bdd246841980
26 lines
981 B
Text
26 lines
981 B
Text
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");
|
|
}
|
|
)
|
|
does often compile under bf(C), though with a warning that ti(printf()) is
|
|
not a known function. Many bf(C++) compilers will fail to produce code in such
|
|
a situation. The error is of course the missing ti(#include <stdio.h>)
|
|
directive.
|
|
|
|
Although, while we're at it: in bf(C++) the function ti(main()) em(always)
|
|
uses the tt(int) i(return value). It is possible to define ti(int main())
|
|
without an i(explicit return) statement, but a ti(return) statement without an
|
|
expression cannot be given inside the tt(main()) function: a tt(return)
|
|
statement in tt(main()) must always be given an tt(int)-expression. For
|
|
example:
|
|
verb(
|
|
int main()
|
|
{
|
|
return; // won't compile: expects int expression
|
|
}
|
|
)
|