[PATCH] diagnostics.h: GCC 13 got -Wself-move, breaks GDB build
Nick Clifton
nickc@redhat.com
Mon Oct 3 13:49:55 GMT 2022
Hi Jan-Benedict,
> +# if __GNUC__ >= 13
> +# define DIAGNOSTIC_IGNORE_SELF_MOVE DIAGNOSTIC_IGNORE ("-Wself-move")
> +# endif
There appears to be a convention that the definition should be broken
up over two lines, ie:
# if __GNUC__ >= 13
# define DIAGNOSTIC_IGNORE_SELF_MOVE \
DIAGNOSTIC_IGNORE ("-Wself-move")
# endif
Although DIAGNOSTIC_ERROR_SWITCH appears to be the exception to this rule.
More importantly however, you need to provide an empty definition at the
end of the file should the macro not be defined. ie:
#ifndef DIAGNOSTIC_IGNORE_SELF_MOVE
# define DIAGNOSTIC_IGNORE_SELF_MOVE
#endif
Cheers
Nick
More information about the Binutils
mailing list