Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #13599 Bad configuration for std::clamp #7273

Merged
merged 1 commit into from
Feb 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cfg/std.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6373,7 +6373,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 @@ -6393,7 +6393,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 @@ -6407,7 +6407,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
Loading