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

暗黙的cast する ノード にマッチする matcher を作成 #36

Merged
merged 12 commits into from
Jan 16, 2023
Merged
Next Next commit
add: 暗黙的castバグ用ファイルを追加
  • Loading branch information
Ran350 committed Jan 8, 2023
commit 7e86ccdb0a03684a244c5f7c48e082cb33e8e963
13 changes: 13 additions & 0 deletions clang-query/implicitly-cast.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <time.h>

int throwImplicitlyDowncast() {
time_t t = pow(2, 32);
int overflowed = t - (t % 3600);
// double not_overflowed = difftime(t, t % 3600);
return overflowed;
}

int main(void) {
throwImplicitlyDowncast();
return 0;
}
4 changes: 4 additions & 0 deletions clang-query/implicitly-cast.cq
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set traversal IgnoreUnlessSpelledInSource
set bind-root true
set print-matcher true
enable output dump