api: fix -Wformat warnings (#2025)

The main sources of warnings were:

 * Printing of a `size_t` which requires the `%zu` specifier.

 * Printing of `cl_long`/`cl_ulong` which is now done using the `PRI*64`
macros to ensure portability across 32 and 64-bit builds.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This commit is contained in:
Sven van Haastregt
2024-09-02 12:02:28 +02:00
committed by GitHub
parent a7162188d6
commit 90f523ea57
8 changed files with 126 additions and 94 deletions

View File

@@ -13,6 +13,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
#include <cinttypes>
#include "testBase.h"
#include "harness/testHarness.h"
#include "harness/deviceInfo.h"
@@ -158,8 +160,9 @@ static int check_atomic_capabilities(cl_device_atomic_capabilities atomicCaps,
{
if ((atomicCaps & requiredCaps) != requiredCaps)
{
log_error("Atomic capabilities %llx is missing support for at least "
"one required capability %llx!\n",
log_error("Atomic capabilities %" PRIx64
" is missing support for at least "
"one required capability %" PRIx64 "!\n",
atomicCaps, requiredCaps);
return TEST_FAIL;
}