From 346fab44f091e9870a7319f99c824bd0de3d71d1 Mon Sep 17 00:00:00 2001 From: evans Date: Thu, 12 Jul 2001 00:01:17 +0000 Subject: [PATCH] *** empty log message *** --- lib/ansi.h | 4 +++- src/Headers/herald.last | 4 ++-- src/exprNode.c | 14 +++++++++++--- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/lib/ansi.h b/lib/ansi.h index 519e14b..4ce1622 100644 --- a/lib/ansi.h +++ b/lib/ansi.h @@ -858,7 +858,9 @@ extern void /*@alt void * @*/ extern void /*@alt char * @*/ strcpy (/*@unique@*/ /*@out@*/ /*@returned@*/ char *s1, char *s2) - /*@modifies *s1@*/ /*@requires MaxSet(s1) >= MaxRead(s2) @*/ /*@ensures MaxRead(s1) == MaxRead (s2) /\ MaxRead(result) == MaxRead(s2) /\ MaxSet(result) == MaxSet(s1); @*/; + /*@modifies *s1@*/ + /*@requires MaxSet(s1) >= MaxRead(s2) @*/ + /*@ensures MaxRead(s1) == MaxRead (s2) /\ MaxRead(result) == MaxRead(s2) /\ MaxSet(result) == MaxSet(s1); @*/; extern void /*@alt char * @*/ strncpy (/*@unique@*/ /*@out@*/ /*@returned@*/ char *s1, char *s2, size_t n) diff --git a/src/Headers/herald.last b/src/Headers/herald.last index b0c1a78..d2b7ed0 100644 --- a/src/Headers/herald.last +++ b/src/Headers/herald.last @@ -1,7 +1,7 @@ /* herald.h - created automatically by gmake updateversion */ /*@constant observer char *LCL_VERSION;@*/ -# define LCL_VERSION "LCLint 3.0b-alpha --- 20 June 2001" +# define LCL_VERSION "LCLint 3.0.0.6 --- 20 June 2001" /*@constant observer char *LCL_PARSE_VERSION;@*/ -# define LCL_PARSE_VERSION "LCLint 3.0b-alpha" +# define LCL_PARSE_VERSION "LCLint 3.0.0.6" /*@constant observer char *LCL_COMPILE;@*/ # define LCL_COMPILE "Compiled using gcc -Wall -g on Linux paisley 2.4.3-12 #1 Fri Jun 8 13:35:30 EDT 2001 i686 unknown by evans" diff --git a/src/exprNode.c b/src/exprNode.c index 0970500..4f36072 100644 --- a/src/exprNode.c +++ b/src/exprNode.c @@ -1517,7 +1517,8 @@ checkPrintfArgs (/*@notnull@*/ /*@dependent@*/ exprNode f, uentry fcn, case 'p': /* pointer */ expecttype = ctype_makePointer (ctype_void); - /* really! */ + uentry_setDefState (regArg, SS_RELDEF); /* need not be defined */ + sRef_setPosNull (uentry_getSref (regArg), fileloc_undefined); /* could be null */ /*@switchbreak@*/ break; case 'n': /* pointer to int, modified by call! */ @@ -1589,7 +1590,7 @@ checkPrintfArgs (/*@notnull@*/ /*@dependent@*/ exprNode f, uentry fcn, uentry_setType (regArg, ctype_unknown); uentry_fixupSref (regArg); - + if (modified) { exprNode_checkCallModifyVal (a->sref, args, f, ret); @@ -1835,10 +1836,17 @@ checkScanfArgs (/*@notnull@*/ /*@dependent@*/ exprNode f, uentry fcn, expecttype = ctype_string; /*@switchbreak@*/ break; + case 'p': /* pointer */ + voptgenerror + (FLG_FORMATCODE, + message ("Format code should not be used in scanf: %s", + cstring_fromChars (origcode)), + fileloc_isDefined (formatloc) + ? formatloc : g_currentloc); + expecttype = ctype_unknown; - /* really! */ /*@switchbreak@*/ break; case 'n': /* pointer to int, modified by call! */ -- 2.45.1