From: Alan T. DeKok Date: Sat, 25 Oct 2025 15:37:37 +0000 (-0400) Subject: remove -Wno-cast-align X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e538657fe05325cbd84453fc034d3a9b8598735;p=thirdparty%2Ffreeradius-server.git remove -Wno-cast-align Some configure output had both -Wcast-align and -Wno-cast-align, which doesn't make any sense. The -Wno-cast-align is there to quiet issues with sbuff.h and dbuff.h. Those header files define macros which use two _Generic statements, one for each function argument. However, such use of _Generic isn't limited to treating each case independently. Instead, all possible combinations of _Generics must be valid, even ones which don't make sense (and aren't chosen). This results in the compiler complaining. Since we don't understand what's going on there, we just disable -Wcast-align for those two header files, and leave it globally enabled for everything else. --- diff --git a/configure b/configure index 6b283eb9f66..501dde98a89 100755 --- a/configure +++ b/configure @@ -13690,7 +13690,6 @@ printf "%s\n" "$ax_cv_cc_weverything_flag" >&6; } -Wno-date-time \ -Wno-disabled-macro-expansion \ -Wno-format-pedantic \ - -Wno-cast-align \ -Wno-conversion \ -Wno-covered-switch-default \ -Wno-documentation-unknown-command \ @@ -13722,7 +13721,6 @@ printf "%s\n" "$ax_cv_cc_weverything_flag" >&6; } -Wmissing-declarations \ -Wmissing-prototypes \ -Wnested-externs \ - -Wno-cast-align \ -Wno-format-extra-args \ -Wno-format-zero-length \ -Wpointer-arith \ diff --git a/configure.ac b/configure.ac index b6fe7a9b84a..365459dfb93 100644 --- a/configure.ac +++ b/configure.ac @@ -2000,7 +2000,6 @@ if test "x$developer" = "xyes"; then -Wmissing-declarations \ -Wmissing-prototypes \ -Wnested-externs \ - -Wno-cast-align \ -Wno-format-extra-args \ -Wno-format-zero-length \ -Wpointer-arith \ diff --git a/src/lib/util/dbuff.h b/src/lib/util/dbuff.h index 348a481e9e6..f613c11bd1c 100644 --- a/src/lib/util/dbuff.h +++ b/src/lib/util/dbuff.h @@ -38,6 +38,8 @@ extern "C" { #include #include +DIAG_OFF(cast-align) + /** A dbuff * * dbuffs wrap an underlying buffer, maintaining 'start', 'current', and 'end' @@ -1059,6 +1061,7 @@ _fr_dbuff_set_end(\ ) \ ) + /** Advance 'current' position in dbuff or marker by _len bytes * * @param[in] _dbuff_or_marker to advance. @@ -1898,7 +1901,6 @@ static inline ssize_t _fr_dbuff_out_int64v(int64_t *num, uint8_t **pos_p, fr_dbu #define FR_DBUFF_OUT_INT64V_RETURN(_num, _dbuff_or_marker, _len) FR_DBUFF_RETURN(fr_dbuff_out_int64v, _num, _dbuff_or_marker, _len) /** @} */ - #ifdef __cplusplus } #endif diff --git a/src/lib/util/sbuff.h b/src/lib/util/sbuff.h index 0f226f9915e..ed6def0746f 100644 --- a/src/lib/util/sbuff.h +++ b/src/lib/util/sbuff.h @@ -61,6 +61,7 @@ typedef struct fr_sbuff_ptr_s fr_sbuff_marker_t; * */ DIAG_OFF(attributes) +DIAG_OFF(cast-align) typedef enum CC_HINT(flag_enum) { FR_SBUFF_FLAG_EXTENDED = 0x01, //!< The last call to extend function actually extended the buffer. FR_SBUFF_FLAG_EXTEND_ERROR = 0x02 //!< The last call to an extend function resulted in an error. @@ -843,7 +844,7 @@ static inline fr_sbuff_t *fr_sbuff_init_talloc(TALLOC_CTX *ctx, /** Return a pointer to the 'end' position of an sbuff or one of its markers * * @param[in] _sbuff_or_marker to return the end position of. - * @return A pointer to the end position of the buffer or marker. +< * @return A pointer to the end position of the buffer or marker. */ #define fr_sbuff_end(_sbuff_or_marker) \ (_Generic((_sbuff_or_marker), \