mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
13 lines
246 B
C
13 lines
246 B
C
# define likely(x) __builtin_expect(!!(x), 1)
|
|
int sscanf(const char *s, const char *format, ...);
|
|
|
|
void use(int i);
|
|
|
|
void test_likely(const char* s, const char* format)
|
|
{
|
|
int x;
|
|
|
|
if (likely(sscanf(s, format, &x) == 1)) {
|
|
use(x); // GOOD
|
|
}
|
|
} |