Skip to content

Commit 12bb30b

Browse files
committed
Incorporated review comments
1 parent cb9b6d5 commit 12bb30b

File tree

2 files changed

+16
-19
lines changed
  • TESTS/mbed_platform/minimal-printf/compliance
  • tools/toolchains

2 files changed

+16
-19
lines changed

TESTS/mbed_platform/minimal-printf/compliance/main.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static control_t test_printf_d(const size_t call_count)
5252
/*************************************************************************/
5353
/*************************************************************************/
5454
#if !defined(__NEWLIB_NANO)
55-
//Printf with %hhd is not supported by Newlib-Nano
55+
// The format specifier %hhd is not supported by Newlib-Nano
5656
result_minimal = mbed_printf("hhd: %hhd\r\n", SCHAR_MIN);
5757
result_file = mbed_fprintf(stderr, "hhd: %hhd\r\n", SCHAR_MIN);
5858
result_baseline = printf("hhd: %hhd\r\n", SCHAR_MIN);
@@ -103,7 +103,7 @@ static control_t test_printf_d(const size_t call_count)
103103
TEST_ASSERT_EQUAL_INT(result_baseline, result_file);
104104

105105
#if !defined(__NEWLIB_NANO)
106-
//Printf with %lld is not supported by Newlib-Nano
106+
// The format specifier %lld is not supported by Newlib-Nano
107107
result_minimal = mbed_printf("lld: %lld\r\n", LLONG_MIN);
108108
result_file = mbed_fprintf(stderr, "lld: %lld\r\n", LLONG_MIN);
109109
result_baseline = printf("lld: %lld\r\n", LLONG_MIN);
@@ -177,7 +177,7 @@ static control_t test_printf_u(const size_t call_count)
177177
/*************************************************************************/
178178
/*************************************************************************/
179179
#if !defined(__NEWLIB_NANO)
180-
//Printf with %hhu is not supported by Newlib-Nano
180+
// The format specifier %hhu is not supported by Newlib-Nano
181181
result_minimal = mbed_printf("hhu: %hhu\r\n", 0);
182182
result_file = mbed_fprintf(stderr, "hhu: %hhu\r\n", 0);
183183
result_baseline = printf("hhu: %hhu\r\n", 0);
@@ -227,7 +227,7 @@ static control_t test_printf_u(const size_t call_count)
227227
TEST_ASSERT_EQUAL_INT(result_baseline, result_minimal);
228228
TEST_ASSERT_EQUAL_INT(result_baseline, result_file);
229229
#if !defined(__NEWLIB_NANO)
230-
//Printf with %llu is not supported by Newlib-Nano
230+
// The format specifier %llu is not supported by Newlib-Nano
231231
result_minimal = mbed_printf("llu: %llu\r\n", 0ULL);
232232
result_file = mbed_fprintf(stderr, "llu: %llu\r\n", 0ULL);
233233
result_baseline = printf("llu: %llu\r\n", 0ULL);
@@ -301,7 +301,7 @@ static control_t test_printf_x(const size_t call_count)
301301
/*************************************************************************/
302302
/*************************************************************************/
303303
#if !defined(__NEWLIB_NANO)
304-
//Printf with %hhX is not supported by Newlib-Nano
304+
// The format specifier %hhX is not supported by Newlib-Nano
305305
result_minimal = mbed_printf("hhX: %hhX\r\n", 0);
306306
result_file = mbed_fprintf(stderr, "hhX: %hhX\r\n", 0);
307307
result_baseline = printf("hhX: %hhX\r\n", 0);
@@ -351,7 +351,7 @@ static control_t test_printf_x(const size_t call_count)
351351
TEST_ASSERT_EQUAL_INT(result_baseline, result_minimal);
352352
TEST_ASSERT_EQUAL_INT(result_baseline, result_file);
353353
#if !defined(__NEWLIB_NANO)
354-
//Printf with %llX is not supported by Newlib-Nano
354+
// The format specifier %llX is not supported by Newlib-Nano
355355
result_minimal = mbed_printf("llX: %llX\r\n", 0ULL);
356356
result_file = mbed_fprintf(stderr, "llX: %llX\r\n", 0ULL);
357357
result_baseline = printf("llX: %llX\r\n", 0ULL);
@@ -451,7 +451,7 @@ static control_t test_snprintf_d(const size_t call_count)
451451
/*************************************************************************/
452452
/*************************************************************************/
453453
#if !defined(__NEWLIB_NANO)
454-
//Printf with %hhd is not supported by Newlib-Nano
454+
// The format specifier %hhd is not supported by Newlib-Nano
455455
result_minimal = mbed_snprintf(buffer_minimal, sizeof(buffer_minimal), "hhd: %hhd\r\n", SCHAR_MIN);
456456
result_baseline = snprintf(buffer_baseline, sizeof(buffer_baseline), "hhd: %hhd\r\n", SCHAR_MIN);
457457
TEST_ASSERT_EQUAL_STRING(buffer_baseline, buffer_minimal);
@@ -494,7 +494,7 @@ static control_t test_snprintf_d(const size_t call_count)
494494
TEST_ASSERT_EQUAL_INT(result_baseline, result_minimal);
495495

496496
#if !defined(__NEWLIB_NANO)
497-
//Printf with %lld is not supported by Newlib-Nano
497+
// The format specifier %lld is not supported by Newlib-Nano
498498
result_minimal = mbed_snprintf(buffer_minimal, sizeof(buffer_minimal), "lld: %lld\r\n", LLONG_MIN);
499499
result_baseline = snprintf(buffer_baseline, sizeof(buffer_baseline), "lld: %lld\r\n", LLONG_MIN);
500500
TEST_ASSERT_EQUAL_STRING(buffer_baseline, buffer_minimal);
@@ -561,7 +561,7 @@ static control_t test_snprintf_u(const size_t call_count)
561561
/*************************************************************************/
562562
/*************************************************************************/
563563
#if !defined(__NEWLIB_NANO)
564-
//Printf with %hhu is not supported by Newlib-Nano
564+
// The format specifier %hhu is not supported by Newlib-Nano
565565
result_minimal = mbed_snprintf(buffer_minimal, sizeof(buffer_minimal), "hhu: %hhu\r\n", 0);
566566
result_baseline = snprintf(buffer_baseline, sizeof(buffer_baseline), "hhu: %hhu\r\n", 0);
567567
TEST_ASSERT_EQUAL_STRING(buffer_baseline, buffer_minimal);
@@ -603,7 +603,7 @@ static control_t test_snprintf_u(const size_t call_count)
603603
TEST_ASSERT_EQUAL_STRING(buffer_baseline, buffer_minimal);
604604
TEST_ASSERT_EQUAL_INT(result_baseline, result_minimal);
605605
#if !defined(__NEWLIB_NANO)
606-
//Printf with %llu is not supported by Newlib-Nano
606+
// The format specifier %llu is not supported by Newlib-Nano
607607
result_minimal = mbed_snprintf(buffer_minimal, sizeof(buffer_minimal), "llu: %llu\r\n", 0ULL);
608608
result_baseline = snprintf(buffer_baseline, sizeof(buffer_baseline), "llu: %llu\r\n", 0ULL);
609609
TEST_ASSERT_EQUAL_STRING(buffer_baseline, buffer_minimal);
@@ -670,7 +670,7 @@ static control_t test_snprintf_x(const size_t call_count)
670670
/*************************************************************************/
671671
/*************************************************************************/
672672
#if !defined(__NEWLIB_NANO)
673-
//Printf with %hhX is not supported by Newlib-Nano
673+
// The format specifier %hhX is not supported by Newlib-Nano
674674
result_minimal = mbed_snprintf(buffer_minimal, sizeof(buffer_minimal), "hhX: %hhX\r\n", 0);
675675
result_baseline = snprintf(buffer_baseline, sizeof(buffer_baseline), "hhX: %hhX\r\n", 0);
676676
TEST_ASSERT_EQUAL_STRING(buffer_baseline, buffer_minimal);
@@ -711,7 +711,7 @@ static control_t test_snprintf_x(const size_t call_count)
711711
TEST_ASSERT_EQUAL_STRING(buffer_baseline, buffer_minimal);
712712
TEST_ASSERT_EQUAL_INT(result_baseline, result_minimal);
713713
#if !defined(__NEWLIB_NANO)
714-
//Printf with %llX is not supported by Newlib-Nano
714+
// The format specifier %llX is not supported by Newlib-Nano
715715
result_minimal = mbed_snprintf(buffer_minimal, sizeof(buffer_minimal), "llX: %llX\r\n", 0ULL);
716716
result_baseline = snprintf(buffer_baseline, sizeof(buffer_baseline), "llX: %llX\r\n", 0ULL);
717717
TEST_ASSERT_EQUAL_STRING(buffer_baseline, buffer_minimal);
@@ -935,7 +935,7 @@ static control_t test_snprintf_buffer_overflow_ld(const size_t call_count)
935935
}
936936

937937
#if !defined(__NEWLIB_NANO)
938-
//Printf with %lld is not supported by Newlib-Nano
938+
// The format specifier %lld is not supported by Newlib-Nano
939939
static control_t test_snprintf_buffer_overflow_lld(const size_t call_count)
940940
{
941941
return test_snprintf_buffer_overflow_generic<long long, sizeof("lld: -1099511627776")>("lld: %lld", -1099511627776LL);
@@ -953,7 +953,7 @@ static control_t test_snprintf_buffer_overflow_lu(const size_t call_count)
953953
}
954954

955955
#if !defined(__NEWLIB_NANO)
956-
//Printf with %llu is not supported by Newlib-Nano
956+
// The format specifier %llu is not supported by Newlib-Nano
957957
static control_t test_snprintf_buffer_overflow_llu(const size_t call_count)
958958
{
959959
return test_snprintf_buffer_overflow_generic<unsigned long long, sizeof("llu: 1099511627776")>("llu: %llu", 1099511627776ULL);
@@ -971,7 +971,7 @@ static control_t test_snprintf_buffer_overflow_lx(const size_t call_count)
971971
}
972972

973973
#if !defined(__NEWLIB_NANO)
974-
//Printf with %llx is not supported by Newlib-Nano
974+
// The format specifier %llx is not supported by Newlib-Nano
975975
static control_t test_snprintf_buffer_overflow_llx(const size_t call_count)
976976
{
977977
return test_snprintf_buffer_overflow_generic<unsigned long long, sizeof("llx: 0x10000000000")>("llx: 0x%llx", 0x10000000000ULL);
@@ -1005,7 +1005,7 @@ Case cases[] = {
10051005
Case("snprintf buffer overflow %x", test_snprintf_buffer_overflow_x),
10061006
Case("snprintf buffer overflow %lx", test_snprintf_buffer_overflow_lx),
10071007
#if !defined(__NEWLIB_NANO)
1008-
//Printf with %lld,%llu,%llx is not supported by Newlib-Nano
1008+
// The format specifier %lld,%llu,%llx is not supported by Newlib-Nano
10091009
Case("snprintf buffer overflow %lld", test_snprintf_buffer_overflow_lld),
10101010
Case("snprintf buffer overflow %llu", test_snprintf_buffer_overflow_llu),
10111011
Case("snprintf buffer overflow %llx", test_snprintf_buffer_overflow_llx),

tools/toolchains/gcc.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ def __init__(self, target, notify=None, macros=None, build_profile=None,
5555
elif hasattr(target, "default_build"):
5656
default_lib = target.default_build
5757

58-
if not default_lib:
59-
raise NotSupportedException("default_lib is not set")
60-
6158
if default_lib == "small":
6259
common_flags = ["-DMBED_RTOS_SINGLE_THREAD", "-D__NEWLIB_NANO"]
6360
self.flags["common"].extend(common_flags)

0 commit comments

Comments
 (0)