Compilation failure with gcc 14.2 and Mbed-TLS and aarch64 CPU type
Author: sbrahulCreated Apr 27, 2026Updated Aug 29, 2026
When using gcc 14.2 with aarch64 CPU type and Mbed-TLS, I see a compilation error for an undeclared macro and fix looks to be just to add a specific include:
bufferevent_mbedtls.c: In function 'bufferevent_mbedtls_socket_new':
bufferevent_mbedtls.c:374:35: error: 'LONG_MAX' undeclared (first use in this function)
374 | have_fd = LONG_MAX;
| ^~~~~~~~
bufferevent_mbedtls.c:48:1: note: 'LONG_MAX' is defined in header '<limits.h>'; this is probably fixable by adding '#include <limits.h>'
47 | #include "mm-internal.h"
+++ |+#include <limits.h>
48 |
bufferevent_mbedtls.c:374:35: note: each undeclared identifier is reported only once for each function it appears in
374 | have_fd = LONG_MAX;
| ^~~~~~~~
make[1]: *** [Makefile:2093: libevent_mbedtls_la-bufferevent_mbedtls.lo] Error 1Source: libevent/libevent