From: Andrew Bartlett Date: Mon, 8 Nov 2010 21:27:18 +0000 (+1100) Subject: heimdal: fixed the use of error_message() in heimdal X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=2e34d7cf6e55cbc3778954c62ef4a3d153dd12ce;p=metze%2Fheimdal%2Fwip.git heimdal: fixed the use of error_message() in heimdal the lex code in heimdal had a function error_message() which is confusingly the ame as a core function from the com_err library. This replaces it with lex_error_message(), and allows Samba4 to have a stricter check for duplicate symbols between it's components. Pair-Programmed-With: Andrew Tridgell Signed-off-by: Love Hornquist Astrand --- diff --git a/lib/asn1/asn1parse.y b/lib/asn1/asn1parse.y index 611c5b521..dad7f67a2 100644 --- a/lib/asn1/asn1parse.y +++ b/lib/asn1/asn1parse.y @@ -241,14 +241,14 @@ ModuleDefinition: IDENTIFIER objid_opt kw_DEFINITIONS TagDefault ExtensionDefaul TagDefault : kw_EXPLICIT kw_TAGS | kw_IMPLICIT kw_TAGS - { error_message("implicit tagging is not supported"); } + { lex_error_message("implicit tagging is not supported"); } | kw_AUTOMATIC kw_TAGS - { error_message("automatic tagging is not supported"); } + { lex_error_message("automatic tagging is not supported"); } | /* empty */ ; ExtensionDefault: kw_EXTENSIBILITY kw_IMPLIED - { error_message("no extensibility options supported"); } + { lex_error_message("no extensibility options supported"); } | /* empty */ ; @@ -353,9 +353,9 @@ BooleanType : kw_BOOLEAN range : '(' Value RANGE Value ')' { if($2->type != integervalue) - error_message("Non-integer used in first part of range"); + lex_error_message("Non-integer used in first part of range"); if($2->type != integervalue) - error_message("Non-integer in second part of range"); + lex_error_message("Non-integer in second part of range"); $$ = ecalloc(1, sizeof(*$$)); $$->min = $2->u.integervalue; $$->max = $4->u.integervalue; @@ -363,7 +363,7 @@ range : '(' Value RANGE Value ')' | '(' Value RANGE kw_MAX ')' { if($2->type != integervalue) - error_message("Non-integer in first part of range"); + lex_error_message("Non-integer in first part of range"); $$ = ecalloc(1, sizeof(*$$)); $$->min = $2->u.integervalue; $$->max = $2->u.integervalue - 1; @@ -371,7 +371,7 @@ range : '(' Value RANGE Value ')' | '(' kw_MIN RANGE Value ')' { if($4->type != integervalue) - error_message("Non-integer in second part of range"); + lex_error_message("Non-integer in second part of range"); $$ = ecalloc(1, sizeof(*$$)); $$->min = $4->u.integervalue + 2; $$->max = $4->u.integervalue; @@ -379,7 +379,7 @@ range : '(' Value RANGE Value ')' | '(' Value ')' { if($2->type != integervalue) - error_message("Non-integer used in limit"); + lex_error_message("Non-integer used in limit"); $$ = ecalloc(1, sizeof(*$$)); $$->min = $2->u.integervalue; $$->max = $2->u.integervalue; @@ -550,7 +550,7 @@ DefinedType : IDENTIFIER Symbol *s = addsym($1); $$ = new_type(TType); if(s->stype != Stype && s->stype != SUndefined) - error_message ("%s is not a type\n", $1); + lex_error_message ("%s is not a type\n", $1); else $$->symbol = s; } @@ -606,7 +606,7 @@ ContentsConstraint: kw_CONTAINING Type | kw_ENCODED kw_BY Value { if ($3->type != objectidentifiervalue) - error_message("Non-OID used in ENCODED BY constraint"); + lex_error_message("Non-OID used in ENCODED BY constraint"); $$ = new_constraint_spec(CT_CONTENTS); $$->u.content.type = NULL; $$->u.content.encoding = $3; @@ -614,7 +614,7 @@ ContentsConstraint: kw_CONTAINING Type | kw_CONTAINING Type kw_ENCODED kw_BY Value { if ($5->type != objectidentifiervalue) - error_message("Non-OID used in ENCODED BY constraint"); + lex_error_message("Non-OID used in ENCODED BY constraint"); $$ = new_constraint_spec(CT_CONTENTS); $$->u.content.type = $2; $$->u.content.encoding = $5; @@ -851,7 +851,7 @@ objid_element : IDENTIFIER '(' NUMBER ')' Symbol *s = addsym($1); if(s->stype != SValue || s->value->type != objectidentifiervalue) { - error_message("%s is not an object identifier\n", + lex_error_message("%s is not an object identifier\n", s->name); exit(1); } @@ -884,7 +884,7 @@ Valuereference : IDENTIFIER { Symbol *s = addsym($1); if(s->stype != SValue) - error_message ("%s is not a value\n", + lex_error_message ("%s is not a value\n", s->name); else $$ = s->value; @@ -942,7 +942,7 @@ ObjectIdentifierValue: objid void yyerror (const char *s) { - error_message ("%s\n", s); + lex_error_message ("%s\n", s); } static Type * diff --git a/lib/asn1/gen_decode.c b/lib/asn1/gen_decode.c index ad76c0725..002a471e9 100644 --- a/lib/asn1/gen_decode.c +++ b/lib/asn1/gen_decode.c @@ -143,10 +143,10 @@ find_tag (const Type *t, case TType: if ((t->symbol->stype == Stype && t->symbol->type == NULL) || t->symbol->stype == SUndefined) { - error_message("%s is imported or still undefined, " - " can't generate tag checking data in CHOICE " - "without this information", - t->symbol->name); + lex_error_message("%s is imported or still undefined, " + " can't generate tag checking data in CHOICE " + "without this information", + t->symbol->name); exit(1); } find_tag(t->symbol->type, cl, ty, tag); diff --git a/lib/asn1/lex.h b/lib/asn1/lex.h index abca8f723..1ee534178 100644 --- a/lib/asn1/lex.h +++ b/lib/asn1/lex.h @@ -35,7 +35,7 @@ #include -void error_message (const char *, ...) +void lex_error_message (const char *, ...) __attribute__ ((format (printf, 1, 2))); extern int error_flag; diff --git a/lib/asn1/lex.l b/lib/asn1/lex.l index 7bd442bc5..dece09616 100644 --- a/lib/asn1/lex.l +++ b/lib/asn1/lex.l @@ -258,7 +258,7 @@ WITH { return kw_WITH; } yylval.constant = strtol((const char *)yytext, &e, 0); if(e == y) - error_message("malformed constant (%s)", yytext); + lex_error_message("malformed constant (%s)", yytext); else return NUMBER; } @@ -270,7 +270,7 @@ WITH { return kw_WITH; } \n { ++lineno; } \.\.\. { return ELLIPSIS; } \.\. { return RANGE; } -. { error_message("Ignoring char(%c)\n", *yytext); } +. { lex_error_message("Ignoring char(%c)\n", *yytext); } %% #ifndef yywrap /* XXX */ @@ -282,7 +282,7 @@ yywrap () #endif void -error_message (const char *format, ...) +lex_error_message (const char *format, ...) { va_list args; @@ -296,5 +296,5 @@ error_message (const char *format, ...) static void unterminated(const char *type, unsigned start_lineno) { - error_message("unterminated %s, possibly started on line %d\n", type, start_lineno); + lex_error_message("unterminated %s, possibly started on line %d\n", type, start_lineno); } diff --git a/lib/asn1/symbol.c b/lib/asn1/symbol.c index e65876a03..b05f68fa7 100644 --- a/lib/asn1/symbol.c +++ b/lib/asn1/symbol.c @@ -93,7 +93,7 @@ checkfunc(void *ptr, void *arg) { Symbol *s = ptr; if (s->stype == SUndefined) { - error_message("%s is still undefined\n", s->name); + lex_error_message("%s is still undefined\n", s->name); *(int *) arg = 1; } return 0;