Skip to content

Commit

Permalink
Fix #13599 Bad configuration for std::clamp (#7273)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github authored Feb 1, 2025
1 parent 81f0086 commit 4e59e90
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cfg/std.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6374,7 +6374,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<!-- template< class T > constexpr const T& std::clamp( const T& v, const T& lo, const T& hi); (since C++17) -->
<!-- template< class T, class Compare > constexpr const T& std::clamp( const T& v, const T& lo, const T& hi, Compare comp ); (since C++17) -->
<!-- https://en.cppreference.com/w/cpp/algorithm/clamp -->
<function name="clamp,std::clamp">
<function name="std::clamp">
<use-retval/>
<noreturn>false</noreturn>
<leak-ignore/>
Expand All @@ -6394,7 +6394,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
</arg>
</function>
<!-- template <class T> const T& min(const T& a, const T& b); -->
<function name="min,std::min">
<function name="std::min">
<use-retval/>
<noreturn>false</noreturn>
<leak-ignore/>
Expand All @@ -6408,7 +6408,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
</arg>
</function>
<!-- template <class T> const T& max(const T& a, const T& b); -->
<function name="max,std::max">
<function name="std::max">
<use-retval/>
<noreturn>false</noreturn>
<leak-ignore/>
Expand Down
5 changes: 5 additions & 0 deletions test/cfg/std.c
Original file line number Diff line number Diff line change
Expand Up @@ -4897,6 +4897,11 @@ void ignoredReturnValue_abs(int i)
abs(-100);
}

int clamp(int, int, int, int); // #13599
void ignoredReturnValue_clamp(int a, int b, int c, int d) {
clamp(a, b, c, d); // not a library function
}

void nullPointer_asctime(void)
{
const struct tm *tm = 0;
Expand Down

0 comments on commit 4e59e90

Please sign in to comment.