diff options
author | fche <fche> | 2005-09-03 16:52:41 +0000 |
---|---|---|
committer | fche <fche> | 2005-09-03 16:52:41 +0000 |
commit | 6a505121fc997e6f21d26f8c8656f99e58faaaab (patch) | |
tree | a40bb598454cf046c55c54ddfb46f83492fbdcb9 /stap.1.in | |
parent | d9e1dc7a03b0341bc924ba4a008a31676dbc9510 (diff) | |
download | systemtap-steved-6a505121fc997e6f21d26f8c8656f99e58faaaab.tar.gz systemtap-steved-6a505121fc997e6f21d26f8c8656f99e58faaaab.tar.xz systemtap-steved-6a505121fc997e6f21d26f8c8656f99e58faaaab.zip |
2005-09-03 Frank Ch. Eigler <fche@elastic.org>
PR 1292, by popular request.
* parse.cxx (parse_functiondecl): Allow optional value/param type
declarations.
* stap.1.in: Document this.
* tapset/*.stp: Convert most functions accordingly.
* testsuite/parseok/twelve.stp, semok/seven.stp,
semko/twenty.stp: Test this.
Diffstat (limited to 'stap.1.in')
-rw-r--r-- | stap.1.in | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -315,8 +315,18 @@ function thisfn (arg1, arg2) { return arg1 + arg2 } .ESAMPLE -Note the usual absence of type declarations, which are instead -inferred by the translator. Functions may call others or themselves +Note the general absence of type declarations, which are instead +inferred by the translator. However, if desired, a function +definition may include explicit type declarations for its return value +and/or its arguments. This is especially helpful for embedded-C +functions. In the following example, the type inference engine need +only infer type type of arg2 (a string). +.SAMPLE +function thatfn:string (arg1:long, arg2) { + return string(arg1) . arg2 +} +.ESAMPLE +Functions may call others or themselves recursively, up to a fixed nesting limit. This limit is defined by a macro in the translated C code and is in the neighbourhood of 30. |