diff options
author | jbj <jbj> | 2002-07-02 23:54:38 +0000 |
---|---|---|
committer | jbj <jbj> | 2002-07-02 23:54:38 +0000 |
commit | 60d1a9abc0d3cdd45d3bd98f11db7ec5f1aa211a (patch) | |
tree | 8ad45d01da7d9a49bc97e3409af59cb518b07334 | |
parent | 67b64b7205108ee9b1ea84f337b6cbd820eb19f8 (diff) | |
download | libpopt-60d1a9abc0d3cdd45d3bd98f11db7ec5f1aa211a.tar.gz |
Add boundsread annotations throughout, enable +bounds checking.
Start narrowing the scope of bounds annotations by adding more annotations.
-rw-r--r-- | .lclintrc | 3 | ||||
-rw-r--r-- | popt.c | 2 | ||||
-rw-r--r-- | popthelp.c | 4 | ||||
-rw-r--r-- | test1.c | 2 |
4 files changed, 9 insertions, 2 deletions
@@ -13,8 +13,7 @@ +strict # lclint level # --- in progress -#+bounds # 56 -+boundswrite # 40 ++bounds # --- +partial artifacts -exportlocal # 14 @@ -335,8 +335,10 @@ static int handleAlias(/*@special@*/ poptContext con, if ((con->os - con->optionStack + 1) == POPT_OPTION_DEPTH) return POPT_ERROR_OPTSTOODEEP; +/*@-boundsread@*/ if (nextCharArg && *nextCharArg) con->os->nextCharArg = nextCharArg; +/*@=boundsread@*/ con->os++; con->os->next = 0; @@ -325,6 +325,7 @@ static void singleOptionHelp(FILE * fp, int maxLeftCol, } helpLength = strlen(help); +/*@-boundsread@*/ while (helpLength > lineLength) { const char * ch; char format[10]; @@ -343,6 +344,7 @@ static void singleOptionHelp(FILE * fp, int maxLeftCol, while (isspace(*help) && *help) help++; helpLength = strlen(help); } +/*@=boundsread@*/ if (helpLength) fprintf(fp, "%s\n", help); @@ -479,9 +481,11 @@ static int showHelpIntro(poptContext con, FILE * fp) fprintf(fp, POPT_("Usage:")); if (!(con->flags & POPT_CONTEXT_KEEP_FIRST)) { +/*@-boundsread@*/ /*@-nullderef@*/ /* LCL: wazzup? */ fn = con->optionStack->argv[0]; /*@=nullderef@*/ +/*@=boundsread@*/ if (fn == NULL) return len; if (strchr(fn, '/')) fn = strrchr(fn, '/') + 1; fprintf(fp, " %s", fn); @@ -254,6 +254,7 @@ int main(int argc, const char ** argv) if (singleDash) fprintf(stdout, " -"); +/*@-boundsread@*/ rest = poptGetArgs(optCon); if (rest) { fprintf(stdout, " rest:"); @@ -262,6 +263,7 @@ int main(int argc, const char ** argv) rest++; } } +/*@=boundsread@*/ fprintf(stdout, "\n"); |