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 <tridge@samba.org>

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
This commit is contained in:
Andrew Bartlett
2010-11-09 08:27:18 +11:00
committed by Love Hornquist Astrand
parent 2e31740f62
commit 2e34d7cf6e
5 changed files with 24 additions and 24 deletions

View File

@@ -241,14 +241,14 @@ ModuleDefinition: IDENTIFIER objid_opt kw_DEFINITIONS TagDefault ExtensionDefaul
TagDefault : kw_EXPLICIT kw_TAGS TagDefault : kw_EXPLICIT kw_TAGS
| kw_IMPLICIT 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 | kw_AUTOMATIC kw_TAGS
{ error_message("automatic tagging is not supported"); } { lex_error_message("automatic tagging is not supported"); }
| /* empty */ | /* empty */
; ;
ExtensionDefault: kw_EXTENSIBILITY kw_IMPLIED ExtensionDefault: kw_EXTENSIBILITY kw_IMPLIED
{ error_message("no extensibility options supported"); } { lex_error_message("no extensibility options supported"); }
| /* empty */ | /* empty */
; ;
@@ -353,9 +353,9 @@ BooleanType : kw_BOOLEAN
range : '(' Value RANGE Value ')' range : '(' Value RANGE Value ')'
{ {
if($2->type != integervalue) 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) 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(*$$)); $$ = ecalloc(1, sizeof(*$$));
$$->min = $2->u.integervalue; $$->min = $2->u.integervalue;
$$->max = $4->u.integervalue; $$->max = $4->u.integervalue;
@@ -363,7 +363,7 @@ range : '(' Value RANGE Value ')'
| '(' Value RANGE kw_MAX ')' | '(' Value RANGE kw_MAX ')'
{ {
if($2->type != integervalue) 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(*$$)); $$ = ecalloc(1, sizeof(*$$));
$$->min = $2->u.integervalue; $$->min = $2->u.integervalue;
$$->max = $2->u.integervalue - 1; $$->max = $2->u.integervalue - 1;
@@ -371,7 +371,7 @@ range : '(' Value RANGE Value ')'
| '(' kw_MIN RANGE Value ')' | '(' kw_MIN RANGE Value ')'
{ {
if($4->type != integervalue) 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(*$$)); $$ = ecalloc(1, sizeof(*$$));
$$->min = $4->u.integervalue + 2; $$->min = $4->u.integervalue + 2;
$$->max = $4->u.integervalue; $$->max = $4->u.integervalue;
@@ -379,7 +379,7 @@ range : '(' Value RANGE Value ')'
| '(' Value ')' | '(' Value ')'
{ {
if($2->type != integervalue) if($2->type != integervalue)
error_message("Non-integer used in limit"); lex_error_message("Non-integer used in limit");
$$ = ecalloc(1, sizeof(*$$)); $$ = ecalloc(1, sizeof(*$$));
$$->min = $2->u.integervalue; $$->min = $2->u.integervalue;
$$->max = $2->u.integervalue; $$->max = $2->u.integervalue;
@@ -550,7 +550,7 @@ DefinedType : IDENTIFIER
Symbol *s = addsym($1); Symbol *s = addsym($1);
$$ = new_type(TType); $$ = new_type(TType);
if(s->stype != Stype && s->stype != SUndefined) 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 else
$$->symbol = s; $$->symbol = s;
} }
@@ -606,7 +606,7 @@ ContentsConstraint: kw_CONTAINING Type
| kw_ENCODED kw_BY Value | kw_ENCODED kw_BY Value
{ {
if ($3->type != objectidentifiervalue) 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); $$ = new_constraint_spec(CT_CONTENTS);
$$->u.content.type = NULL; $$->u.content.type = NULL;
$$->u.content.encoding = $3; $$->u.content.encoding = $3;
@@ -614,7 +614,7 @@ ContentsConstraint: kw_CONTAINING Type
| kw_CONTAINING Type kw_ENCODED kw_BY Value | kw_CONTAINING Type kw_ENCODED kw_BY Value
{ {
if ($5->type != objectidentifiervalue) 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); $$ = new_constraint_spec(CT_CONTENTS);
$$->u.content.type = $2; $$->u.content.type = $2;
$$->u.content.encoding = $5; $$->u.content.encoding = $5;
@@ -851,7 +851,7 @@ objid_element : IDENTIFIER '(' NUMBER ')'
Symbol *s = addsym($1); Symbol *s = addsym($1);
if(s->stype != SValue || if(s->stype != SValue ||
s->value->type != objectidentifiervalue) { 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); s->name);
exit(1); exit(1);
} }
@@ -884,7 +884,7 @@ Valuereference : IDENTIFIER
{ {
Symbol *s = addsym($1); Symbol *s = addsym($1);
if(s->stype != SValue) if(s->stype != SValue)
error_message ("%s is not a value\n", lex_error_message ("%s is not a value\n",
s->name); s->name);
else else
$$ = s->value; $$ = s->value;
@@ -942,7 +942,7 @@ ObjectIdentifierValue: objid
void void
yyerror (const char *s) yyerror (const char *s)
{ {
error_message ("%s\n", s); lex_error_message ("%s\n", s);
} }
static Type * static Type *

View File

@@ -143,7 +143,7 @@ find_tag (const Type *t,
case TType: case TType:
if ((t->symbol->stype == Stype && t->symbol->type == NULL) if ((t->symbol->stype == Stype && t->symbol->type == NULL)
|| t->symbol->stype == SUndefined) { || t->symbol->stype == SUndefined) {
error_message("%s is imported or still undefined, " lex_error_message("%s is imported or still undefined, "
" can't generate tag checking data in CHOICE " " can't generate tag checking data in CHOICE "
"without this information", "without this information",
t->symbol->name); t->symbol->name);

View File

@@ -35,7 +35,7 @@
#include <roken.h> #include <roken.h>
void error_message (const char *, ...) void lex_error_message (const char *, ...)
__attribute__ ((format (printf, 1, 2))); __attribute__ ((format (printf, 1, 2)));
extern int error_flag; extern int error_flag;

View File

@@ -258,7 +258,7 @@ WITH { return kw_WITH; }
yylval.constant = strtol((const char *)yytext, yylval.constant = strtol((const char *)yytext,
&e, 0); &e, 0);
if(e == y) if(e == y)
error_message("malformed constant (%s)", yytext); lex_error_message("malformed constant (%s)", yytext);
else else
return NUMBER; return NUMBER;
} }
@@ -270,7 +270,7 @@ WITH { return kw_WITH; }
\n { ++lineno; } \n { ++lineno; }
\.\.\. { return ELLIPSIS; } \.\.\. { return ELLIPSIS; }
\.\. { return RANGE; } \.\. { return RANGE; }
. { error_message("Ignoring char(%c)\n", *yytext); } . { lex_error_message("Ignoring char(%c)\n", *yytext); }
%% %%
#ifndef yywrap /* XXX */ #ifndef yywrap /* XXX */
@@ -282,7 +282,7 @@ yywrap ()
#endif #endif
void void
error_message (const char *format, ...) lex_error_message (const char *format, ...)
{ {
va_list args; va_list args;
@@ -296,5 +296,5 @@ error_message (const char *format, ...)
static void static void
unterminated(const char *type, unsigned start_lineno) 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);
} }

View File

@@ -93,7 +93,7 @@ checkfunc(void *ptr, void *arg)
{ {
Symbol *s = ptr; Symbol *s = ptr;
if (s->stype == SUndefined) { 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; *(int *) arg = 1;
} }
return 0; return 0;