public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Use proper print formatter in main function in fixincl.c
@ 2018-12-19 23:35 Nicholas Krause
  2018-12-20  0:20 ` Joseph Myers
  0 siblings, 1 reply; 9+ messages in thread
From: Nicholas Krause @ 2018-12-19 23:35 UTC (permalink / raw)
  To: gcc-patches

This fixes the bug id, 71176 to use the proper known
code print formatter type, %lu for size_t rather than
%d which is considered best pratice for print statements.

Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
---
 fixincludes/fixincl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fixincludes/fixincl.c b/fixincludes/fixincl.c
index 6dba2f6e830..8e16a2f7792 100644
--- a/fixincludes/fixincl.c
+++ b/fixincludes/fixincl.c
@@ -159,7 +159,7 @@ main (int argc, char** argv)
     tSCC zFmt[] =
       "\
 Processed %5d files containing %d bytes    \n\
-Applying  %5d fixes to %d files\n\
+Applying  %5d fixes to %lu files\n\
 Altering  %5d of them\n";
 
     fprintf (stderr, zFmt, process_ct, ttl_data_size, apply_ct,
-- 
2.17.1

^ permalink raw reply	[flat|nested] 9+ messages in thread
* [PATCH] Use proper print formatter in main function in fixincl.c
@ 2018-12-20  2:49 Nicholas Krause
  2018-12-20 21:07 ` Joseph Myers
  0 siblings, 1 reply; 9+ messages in thread
From: Nicholas Krause @ 2018-12-20  2:49 UTC (permalink / raw)
  To: gcc-patches

This fixes the bug id, 71176 to use the proper known
code print formatter type, %lu for size_t rather than
%d which is considered best pratice for print statements.

Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
---
 fixincludes/fixincl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fixincludes/fixincl.c b/fixincludes/fixincl.c
index 6dba2f6e830..4e3010df0a6 100644
--- a/fixincludes/fixincl.c
+++ b/fixincludes/fixincl.c
@@ -159,10 +159,10 @@ main (int argc, char** argv)
     tSCC zFmt[] =
       "\
 Processed %5d files containing %d bytes    \n\
-Applying  %5d fixes to %d files\n\
+Applying  %5lu fixes to %d files\n\
 Altering  %5d of them\n";
 
-    fprintf (stderr, zFmt, process_ct, ttl_data_size, apply_ct,
+    fprintf (stderr, zFmt, process_ct, (unsigned long int) ttl_data_size, apply_ct,
              fixed_ct, altered_ct);
   }
 #endif /* DO_STATS */
-- 
2.17.1

^ permalink raw reply	[flat|nested] 9+ messages in thread
* [PATCH] Use proper print formatter in main function in fixincl.c
@ 2018-12-20 22:27 Nicholas Krause
  2019-01-07 15:57 ` Jonathan Wakely
  0 siblings, 1 reply; 9+ messages in thread
From: Nicholas Krause @ 2018-12-20 22:27 UTC (permalink / raw)
  To: gcc-patches

This fixes the bug id, 71176 to use the proper known
code print formatter type, %lu for size_t rather than
%d which is considered best pratice for print statements.

Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
---
 fixincludes/fixincl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fixincludes/fixincl.c b/fixincludes/fixincl.c
index 6dba2f6e830..5b8b77a77f0 100644
--- a/fixincludes/fixincl.c
+++ b/fixincludes/fixincl.c
@@ -158,11 +158,11 @@ main (int argc, char** argv)
   if (VLEVEL( VERB_PROGRESS )) {
     tSCC zFmt[] =
       "\
-Processed %5d files containing %d bytes    \n\
+Processed %5d files containing %lu bytes    \n\
 Applying  %5d fixes to %d files\n\
 Altering  %5d of them\n";
 
-    fprintf (stderr, zFmt, process_ct, ttl_data_size, apply_ct,
+    fprintf (stderr, zFmt, process_ct, (unsigned int long) ttl_data_size, apply_ct,
              fixed_ct, altered_ct);
   }
 #endif /* DO_STATS */
-- 
2.17.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-01-07 16:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-19 23:35 [PATCH] Use proper print formatter in main function in fixincl.c Nicholas Krause
2018-12-20  0:20 ` Joseph Myers
2018-12-20  2:49 Nicholas Krause
2018-12-20 21:07 ` Joseph Myers
2018-12-20 22:19   ` nick
2018-12-20 22:27 Nicholas Krause
2019-01-07 15:57 ` Jonathan Wakely
2019-01-07 16:02   ` NightStrike
2019-01-07 16:04     ` Jonathan Wakely

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).