88import semmle.code.cpp.models.interfaces.FormattingFunction
99import semmle.code.cpp.models.interfaces.Alias
1010import semmle.code.cpp.models.interfaces.SideEffect
11- import semmle.code.cpp.models.interfaces.Throwing
11+ import semmle.code.cpp.models.interfaces.NonThrowing
1212
1313/**
1414 * The standard functions `printf`, `wprintf` and their glib variants.
1515 */
16- private class Printf extends FormattingFunction , AliasFunction , NonThrowingFunction {
16+ private class Printf extends FormattingFunction , AliasFunction , NonCppThrowingFunction {
1717 Printf ( ) {
1818 this instanceof TopLevelFunction and
1919 (
@@ -32,14 +32,12 @@ private class Printf extends FormattingFunction, AliasFunction, NonThrowingFunct
3232 override predicate parameterEscapesOnlyViaReturn ( int n ) { none ( ) }
3333
3434 override predicate parameterIsAlwaysReturned ( int n ) { none ( ) }
35-
36- override TCxxException getExceptionType ( ) { any ( ) }
3735}
3836
3937/**
4038 * The standard functions `fprintf`, `fwprintf` and their glib variants.
4139 */
42- private class Fprintf extends FormattingFunction , NonThrowingFunction {
40+ private class Fprintf extends FormattingFunction , NonCppThrowingFunction {
4341 Fprintf ( ) {
4442 this instanceof TopLevelFunction and
4543 (
@@ -52,14 +50,12 @@ private class Fprintf extends FormattingFunction, NonThrowingFunction {
5250 override int getFormatParameterIndex ( ) { result = 1 }
5351
5452 override int getOutputParameterIndex ( boolean isStream ) { result = 0 and isStream = true }
55-
56- override TCxxException getExceptionType ( ) { any ( ) }
5753}
5854
5955/**
6056 * The standard function `sprintf` and its Microsoft and glib variants.
6157 */
62- private class Sprintf extends FormattingFunction , NonThrowingFunction {
58+ private class Sprintf extends FormattingFunction , NonCppThrowingFunction {
6359 Sprintf ( ) {
6460 this instanceof TopLevelFunction and
6561 (
@@ -97,14 +93,14 @@ private class Sprintf extends FormattingFunction, NonThrowingFunction {
9793 then result = 4
9894 else result = super .getFirstFormatArgumentIndex ( )
9995 }
100-
101- override TCxxException getExceptionType ( ) { any ( ) }
10296}
10397
10498/**
10599 * Implements `Snprintf`.
106100 */
107- private class SnprintfImpl extends Snprintf , AliasFunction , SideEffectFunction , NonThrowingFunction {
101+ private class SnprintfImpl extends Snprintf , AliasFunction , SideEffectFunction ,
102+ NonCppThrowingFunction
103+ {
108104 SnprintfImpl ( ) {
109105 this instanceof TopLevelFunction and
110106 (
@@ -171,8 +167,6 @@ private class SnprintfImpl extends Snprintf, AliasFunction, SideEffectFunction,
171167 // We don't know how many parameters are passed to the function since it's varargs, but they also have read side effects.
172168 i = this .getFormatParameterIndex ( ) and buffer = true
173169 }
174-
175- override TCxxException getExceptionType ( ) { any ( ) }
176170}
177171
178172/**
@@ -213,7 +207,7 @@ private class StringCchPrintf extends FormattingFunction {
213207/**
214208 * The standard function `syslog`.
215209 */
216- private class Syslog extends FormattingFunction , NonThrowingFunction {
210+ private class Syslog extends FormattingFunction , NonCppThrowingFunction {
217211 Syslog ( ) {
218212 this instanceof TopLevelFunction and
219213 this .hasGlobalName ( "syslog" ) and
@@ -223,6 +217,4 @@ private class Syslog extends FormattingFunction, NonThrowingFunction {
223217 override int getFormatParameterIndex ( ) { result = 1 }
224218
225219 override predicate isOutputGlobal ( ) { any ( ) }
226-
227- override TCxxException getExceptionType ( ) { any ( ) }
228220}
0 commit comments