From a5e98686fc92291abed83366ef0a9d52c49717e3 Mon Sep 17 00:00:00 2001 From: Michael Kaplan Date: Mon, 15 Jan 2018 12:44:43 +0100 Subject: [PATCH] changed warnings in device_uid_api.h to be thrown also when size or str_size_max are zero --- hal/device_uid_api.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hal/device_uid_api.h b/hal/device_uid_api.h index 06150b283b..7dc9675637 100644 --- a/hal/device_uid_api.h +++ b/hal/device_uid_api.h @@ -23,12 +23,12 @@ #if DEVICE_DEVICEUID -#ifndef MBED_DEVICEUID_SIZE -#error "DEVICE UID Vendor implementation must define macro MBED_DEVICEUID_SIZE with the uid size in bytes!" +#if !defined(MBED_DEVICEUID_SIZE) || (MBED_DEVICEUID_SIZE == 0) +#error "DEVICE UID Vendor implementation must define macro MBED_DEVICEUID_SIZE with the non-zero uid size in bytes!" #endif -#ifndef MBED_DEVICEUID_STR_SIZE_MAX -#warning "DEVICE UID max vendor string length not defined! device_uid_get_str() HAL interface is disabled!" +#if !defined(MBED_DEVICEUID_STR_SIZE_MAX) || (MBED_DEVICEUID_STR_SIZE_MAX == 0) +#warning "DEVICE UID max vendor string length not defined or zero! device_uid_get_str() HAL interface is disabled!" #endif #ifdef __cplusplus