mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-05 06:23:58 +08:00
Use gdb_static_assert in charset.c
It currently has a "manual" static assert. gdb/ChangeLog: 2019-10-07 Christian Biesinger <cbiesinger@google.com> * charset.c (your_gdb_wchar_t_is_bogus): Replace with a gdb_static_assert.
This commit is contained in:
@ -946,15 +946,9 @@ default_auto_wide_charset (void)
|
||||
#define ENDIAN_SUFFIX "LE"
|
||||
#endif
|
||||
|
||||
/* The code below serves to generate a compile time error if
|
||||
gdb_wchar_t type is not of size 2 nor 4, despite the fact that
|
||||
macro __STDC_ISO_10646__ is defined.
|
||||
This is better than a gdb_assert call, because GDB cannot handle
|
||||
strings correctly if this size is different. */
|
||||
/* GDB cannot handle strings correctly if this size is different. */
|
||||
|
||||
extern char your_gdb_wchar_t_is_bogus[(sizeof (gdb_wchar_t) == 2
|
||||
|| sizeof (gdb_wchar_t) == 4)
|
||||
? 1 : -1];
|
||||
gdb_static_assert (sizeof (gdb_wchar_t) == 2 || sizeof (gdb_wchar_t) == 4);
|
||||
|
||||
/* intermediate_encoding returns the charset used internally by
|
||||
GDB to convert between target and host encodings. As the test above
|
||||
|
Reference in New Issue
Block a user