mirror of
https://github.com/verilator/verilator.git
synced 2026-10-07 10:33:13 +02:00
Add -Wpedantic for compliance testing.
This commit is contained in:
+17
-5
@@ -175,12 +175,15 @@ void FileLine::lineDirective(const char* textp, int& enterExitRef) {
|
||||
while (*textp && (isspace(*textp) || *textp=='"')) textp++;
|
||||
|
||||
// Grab linenumber
|
||||
bool fail = false;
|
||||
const char* ln = textp;
|
||||
while (*textp && !isspace(*textp)) textp++;
|
||||
if (isdigit(*ln)) {
|
||||
lineno(atoi(ln));
|
||||
}
|
||||
while (*textp && (isspace(*textp) || *textp=='"')) textp++;
|
||||
} else fail = true;
|
||||
while (*textp && (isspace(*textp))) textp++;
|
||||
if (*textp != '"') fail = true;
|
||||
while (*textp && (isspace(*textp) || *textp == '"')) textp++;
|
||||
|
||||
// Grab filename
|
||||
const char* fn = textp;
|
||||
@@ -189,12 +192,21 @@ void FileLine::lineDirective(const char* textp, int& enterExitRef) {
|
||||
string strfn = fn;
|
||||
strfn = strfn.substr(0, textp-fn);
|
||||
filename(strfn);
|
||||
}
|
||||
} else fail = true;
|
||||
|
||||
// Grab level
|
||||
while (*textp && (isspace(*textp) || *textp=='"')) textp++;
|
||||
if (isdigit(*textp)) enterExitRef = atoi(textp);
|
||||
else enterExitRef = 0;
|
||||
if (isdigit(*textp)) {
|
||||
enterExitRef = atoi(textp);
|
||||
if (enterExitRef >= 3) fail = true;
|
||||
} else {
|
||||
enterExitRef = 0;
|
||||
fail = true;
|
||||
}
|
||||
|
||||
if (fail && v3Global.opt.pedantic()) {
|
||||
v3error("`line was not properly formed with '`line number \"filename\" level'\n");
|
||||
}
|
||||
|
||||
//printf ("PPLINE %d '%s'\n", s_lineno, s_filename.c_str());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user