Skip to content

Commit c5b9e86

Browse files
committed
Baremetal: Fix ARM-microlib Greentea test compilation minimal-printf test case run for NUCLEO_F411RE
1 parent a99d9be commit c5b9e86

File tree

1 file changed

+5
-0
lines changed
  • TESTS/mbed_platform/minimal-printf/compliance

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,11 +856,16 @@ static control_t test_snprintf_buffer_overflow_generic(const char *fmt, T data)
856856
char buffer_minimal[buf_size];
857857
int result_baseline;
858858
int result_minimal;
859+
#if !defined(__MICROLIB)
860+
// Microlib snprintf always returns zero if the size
861+
// to copy from the buffer is zero.
862+
// See reported bug https://jira.arm.com/browse/SDCOMP-54710
859863

860864
/* empty buffer test */
861865
result_minimal = mbed_snprintf(buffer_minimal, 0, fmt, data);
862866
result_baseline = snprintf(buffer_baseline, 0, fmt, data);
863867
TEST_ASSERT_EQUAL_INT(result_baseline, result_minimal);
868+
#endif
864869

865870
/* buffer isn't large enough, output needs to be truncated */
866871
result_minimal = mbed_snprintf(buffer_minimal, buf_size - 2, fmt, data);

0 commit comments

Comments
 (0)