Skip to content

Commit

Permalink
Merge pull request #14 from ra3xdh/no_error_on_extra_prop
Browse files Browse the repository at this point in the history
Show warning instead of error on invalid property name
  • Loading branch information
ra3xdh authored Jul 9, 2024
2 parents f4566e4 + 3fbc583 commit 6c558d5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/check_netlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1802,19 +1802,21 @@ static int checker_validate_properties (struct definition_t * root,
{
/* check whether properties are either required or optional */
int type = checker_is_property (available, pair->key);
bool invalid_prop = false;
if (type == PROP_NONE)
{
if (strcmp (def->type, "Def"))
{
logprint (LOG_ERROR,
"line %d: checker error, extraneous property `%s' is "
logprint (LOG_STATUS,
"line %d: checker warning, extraneous property `%s' is "
"invalid in `%s:%s'\n", def->line,
pair->key, def->type, def->instance);
errors++;
// errors++;
invalid_prop = true;
}
}
// do not check zero-length lists
if (pair->value != NULL)
// do not check zero-length lists and non-exisiting properties
if (pair->value != NULL && !invalid_prop)
{
/* check and evaluate the unit scale in a property */
if (!checker_evaluate_scale (pair->value))
Expand Down

0 comments on commit 6c558d5

Please sign in to comment.