George Burgess IV | de45dcb | 2018-03-16 14:15:01 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | // This file makes uses of clang's built-in diagnostic checker. |
| 18 | // While not officially supported by clang, it's used by clang for all of its |
| 19 | // own diagnostic tests. Please see |
| 20 | // https://clang.llvm.org/doxygen/classclang_1_1VerifyDiagnosticConsumer.html#details |
| 21 | // for details. |
| 22 | |
| 23 | // expected-no-diagnostics |
| 24 | |
| 25 | #include <sys/ioctl.h> |
| 26 | |
| 27 | #pragma clang diagnostic warning "-Wsign-conversion" |
| 28 | |
| 29 | void check_no_signedness_warnings(int i, unsigned x) { |
| 30 | ioctl(i, i); |
| 31 | ioctl(i, x); |
| 32 | |
| 33 | ioctl(i, i, nullptr); |
| 34 | ioctl(i, x, nullptr); |
| 35 | } |