Re: latest printf code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 04, 2019 at 10:46:44PM +0100, Luc Van Oostenryck wrote:
> On Fri, Nov 01, 2019 at 04:36:51PM +0000, Ben Dooks wrote:
> > I've put the latest code up at:
> > 
> >  https://github.com/bjdooks-ct/sparse bjdooks/printf20
> > 
> > I think it has all the issues dealt with.
> > 
> > I can't currently post or do a final test as away from work laptop.
> 
> Thank you.
> 
> I've a few more remarks about formatting or naming and
> also some simplifications I would like you make.

In sparse's parlance: 'evaluation' is, essentially, to give
a type to everything needing to be typed. For this it also does
type checking but I see it more as a kind of side-effect.o

Since evaluate_format_printf() is purely doing some verification,
rename it it accordingly.

>From 2048d796dccb6b2997d03a53b1667d1f80c98fbd Mon Sep 17 00:00:00 2001
From: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
Date: Mon, 4 Nov 2019 22:24:24 +0100
Subject: [PATCH 7/7] s/evaluate_format_printf/verify_format_attribute/

---
 evaluate.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/evaluate.c b/evaluate.c
index d27499ccf..e0f9ba5f0 100644
--- a/evaluate.c
+++ b/evaluate.c
@@ -2709,7 +2709,7 @@ static int parse_format_printf(const char **fmtstring,
  * in the parser code which stores the positions of the message and arg
  * start in the ctype.
  */
-static void evaluate_format_printf(struct symbol *fn, struct expression_list *args)
+static void verify_format_attribute(struct symbol *fn, struct expression_list *args)
 {
 	struct format_state state = { };
 	struct expression *expr;
@@ -2802,7 +2802,7 @@ static int evaluate_arguments(struct symbol *fn, struct expression_list *head)
 	FINISH_PTR_LIST(argtype);
 
 	if (Wformat)
-		evaluate_format_printf(fn, head);
+		verify_format_attribute(fn, head);
 
 	return 1;
 }
-- 
2.23.0




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux