summaryrefslogtreecommitdiffstats
path: root/spec/rtems/basedefs/req/printflike-0.yml
blob: 771227fb7c1d0fa969512a1d5237106787d95ede (plain) (blame)
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
28
29
30
31
32
SPDX-License-Identifier: CC-BY-SA-4.0
copyrights:
- Copyright (C) 2020 embedded brains GmbH & Co. KG
enabled-by: true
functional-type: function
links:
- role: interface-function
  uid: ../if/printflike
rationale: |
  Counting of arguments starts at 1 from the left with the
  exception of non-static C++ methods where the counting starts with
  2 due to the implicit ``this`` argument.
references: []
requirement-type: functional
text: |
  When the code is compiled with the GNU C compiler,
  and the ${../if/printflike:/name} macro is used as last part of a
  function declaration or prefixes a function definition,
  and ${../if/printflike:/params[0]/name} as well as
  ${../if/printflike:/params[1]/name} are constant numbers
  referring to two different arguments of that function,
  and the function argument number ${../if/printflike:/params[0]/name}
  is a ``printf``-format string,
  and the function argument number ${../if/printflike:/params[1]/name}
  is the first argument to be used in the ``printf``-format string,
  and all other arguments used in the ``printf``-format string
  are arguments ${../if/printflike:/params[1]/name} + 1,
  ${../if/printflike:/params[1]/name} + 2,
  ${../if/printflike:/params[1]/name} + 3, and so on,
  the macro shall cause the compiler to use this information for
  type checking the format string and arguments.
type: requirement