8
8
import semmle.code.cpp.models.interfaces.FormattingFunction
9
9
import semmle.code.cpp.models.interfaces.Alias
10
10
import semmle.code.cpp.models.interfaces.SideEffect
11
+ import semmle.code.cpp.models.interfaces.NonThrowing
11
12
12
13
/**
13
14
* The standard functions `printf`, `wprintf` and their glib variants.
14
15
*/
15
- private class Printf extends FormattingFunction , AliasFunction {
16
+ private class Printf extends FormattingFunction , AliasFunction , NonThrowingFunction {
16
17
Printf ( ) {
17
18
this instanceof TopLevelFunction and
18
19
(
@@ -36,7 +37,7 @@ private class Printf extends FormattingFunction, AliasFunction {
36
37
/**
37
38
* The standard functions `fprintf`, `fwprintf` and their glib variants.
38
39
*/
39
- private class Fprintf extends FormattingFunction {
40
+ private class Fprintf extends FormattingFunction , NonThrowingFunction {
40
41
Fprintf ( ) {
41
42
this instanceof TopLevelFunction and
42
43
(
@@ -54,7 +55,7 @@ private class Fprintf extends FormattingFunction {
54
55
/**
55
56
* The standard function `sprintf` and its Microsoft and glib variants.
56
57
*/
57
- private class Sprintf extends FormattingFunction {
58
+ private class Sprintf extends FormattingFunction , NonThrowingFunction {
58
59
Sprintf ( ) {
59
60
this instanceof TopLevelFunction and
60
61
(
@@ -97,7 +98,7 @@ private class Sprintf extends FormattingFunction {
97
98
/**
98
99
* Implements `Snprintf`.
99
100
*/
100
- private class SnprintfImpl extends Snprintf , AliasFunction , SideEffectFunction {
101
+ private class SnprintfImpl extends Snprintf , AliasFunction , SideEffectFunction , NonThrowingFunction {
101
102
SnprintfImpl ( ) {
102
103
this instanceof TopLevelFunction and
103
104
(
@@ -172,7 +173,7 @@ private class SnprintfImpl extends Snprintf, AliasFunction, SideEffectFunction {
172
173
* and
173
174
* https://learn.microsoft.com/en-us/previous-versions/windows/embedded/ms860435(v=msdn.10)
174
175
*/
175
- private class StringCchPrintf extends FormattingFunction {
176
+ private class StringCchPrintf extends FormattingFunction , NonThrowingFunction {
176
177
StringCchPrintf ( ) {
177
178
this instanceof TopLevelFunction and
178
179
exists ( string baseName |
@@ -204,7 +205,7 @@ private class StringCchPrintf extends FormattingFunction {
204
205
/**
205
206
* The standard function `syslog`.
206
207
*/
207
- private class Syslog extends FormattingFunction {
208
+ private class Syslog extends FormattingFunction , NonThrowingFunction {
208
209
Syslog ( ) {
209
210
this instanceof TopLevelFunction and
210
211
this .hasGlobalName ( "syslog" ) and
0 commit comments