diff mbox series

[committed,nvptx] Fix Wformat in nvptx_assemble_decl_begin

Message ID 20200909135428.GA7921@delia
State New
Headers show
Series [committed,nvptx] Fix Wformat in nvptx_assemble_decl_begin | expand

Commit Message

Tom de Vries Sept. 9, 2020, 1:54 p.m. UTC
Hi,

I'm running into this warning:
...
src/gcc/config/nvptx/nvptx.c: In function \
  ‘void nvptx_assemble_decl_begin(FILE*, const char*, const char*, \
  const_tree, long int, unsigned int, bool)’:
src/gcc/config/nvptx/nvptx.c:2229:29: warning: format ‘%d’ expects argument \
  of type ‘int’, but argument 5 has type ‘long unsigned int’ [-Wformat=]
     elt_size * BITS_PER_UNIT);
                             ^
...
which I seem to have introduced in commit b9c7fe59f9f "[nvptx] Fix array
dimension in nvptx_assemble_decl_begin", but not noticed due to configuring
with --disable-build-format-warnings.

Fix this by using the appropriate format.

Rebuild cc1 on nvptx.

Committed to trunk.

Thanks,
- Tom

[nvptx] Fix Wformat in nvptx_assemble_decl_begin

gcc/ChangeLog:

	* config/nvptx/nvptx.c (nvptx_assemble_decl_begin): Fix Wformat
	warning.

---
 gcc/config/nvptx/nvptx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c
index 6f393dfea01..0376ad6ce9f 100644
--- a/gcc/config/nvptx/nvptx.c
+++ b/gcc/config/nvptx/nvptx.c
@@ -2224,7 +2224,7 @@  nvptx_assemble_decl_begin (FILE *file, const char *name, const char *section,
      elt_size. */
   init_frag.remaining = (size + elt_size - 1) / elt_size;
 
-  fprintf (file, "%s .align %d .u%d ",
+  fprintf (file, "%s .align %d .u" HOST_WIDE_INT_PRINT_UNSIGNED " ",
 	   section, align / BITS_PER_UNIT,
 	   elt_size * BITS_PER_UNIT);
   assemble_name (file, name);