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.
-Wno-date-time \
-Wno-disabled-macro-expansion \
-Wno-format-pedantic \
- -Wno-cast-align \
-Wno-conversion \
-Wno-covered-switch-default \
-Wno-documentation-unknown-command \
-Wmissing-declarations \
-Wmissing-prototypes \
-Wnested-externs \
- -Wno-cast-align \
-Wno-format-extra-args \
-Wno-format-zero-length \
-Wpointer-arith \
-Wmissing-declarations \
-Wmissing-prototypes \
-Wnested-externs \
- -Wno-cast-align \
-Wno-format-extra-args \
-Wno-format-zero-length \
-Wpointer-arith \
#include <stdint.h>
#include <sys/types.h>
+DIAG_OFF(cast-align)
+
/** A dbuff
*
* dbuffs wrap an underlying buffer, maintaining 'start', 'current', and 'end'
) \
)
+
/** Advance 'current' position in dbuff or marker by _len bytes
*
* @param[in] _dbuff_or_marker to advance.
#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
*
*/
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.
/** 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), \