public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r9-9830] d: Use HOST_WIDE_INT for type size temporaries.
@ 2021-11-18 23:37 Iain Buclaw
0 siblings, 0 replies; only message in thread
From: Iain Buclaw @ 2021-11-18 23:37 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:aa2c493e20483becc7f537bf7e6dacd00e9075af
commit r9-9830-gaa2c493e20483becc7f537bf7e6dacd00e9075af
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date: Thu Nov 18 22:43:40 2021 +0100
d: Use HOST_WIDE_INT for type size temporaries.
These variables are later used as the value for the format specifier
`%wd`, which the expected type may not match dinteger_t, causing
unnecessary -Wformat warnings.
gcc/d/ChangeLog:
* decl.cc (d_finish_decl): Use HOST_WIDE_INT for type size
temporaries.
(cherry picked from commit d6ec661e3931773e2f571ed4f6dd8b0402d8687d)
Diff:
---
gcc/d/decl.cc | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/gcc/d/decl.cc b/gcc/d/decl.cc
index d24f5dcd958..506de51b742 100644
--- a/gcc/d/decl.cc
+++ b/gcc/d/decl.cc
@@ -1559,8 +1559,9 @@ d_finish_decl (tree decl)
if (flag_checking && DECL_INITIAL (decl))
{
/* Initializer must never be bigger than symbol size. */
- dinteger_t tsize = int_size_in_bytes (TREE_TYPE (decl));
- dinteger_t dtsize = int_size_in_bytes (TREE_TYPE (DECL_INITIAL (decl)));
+ HOST_WIDE_INT tsize = int_size_in_bytes (TREE_TYPE (decl));
+ HOST_WIDE_INT dtsize =
+ int_size_in_bytes (TREE_TYPE (DECL_INITIAL (decl)));
if (tsize < dtsize)
{
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-11-18 23:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-18 23:37 [gcc r9-9830] d: Use HOST_WIDE_INT for type size temporaries Iain Buclaw
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).