tools/nxstyle.c: Ignore inttypes.h constants.
Eliminate warnings. Ignore mixed case identifies beginning with PRIx. These most likely come from inttypes.h and we nxstyle must tolerate those definitions even though they do not follow the coding style.
This commit is contained in:
parent
5f7a797e89
commit
2483b65bfb
@ -1264,15 +1264,6 @@ int main(int argc, char **argv, char **envp)
|
||||
/* Check for mixed upper and lower case */
|
||||
|
||||
if (have_upper && have_lower)
|
||||
{
|
||||
/* Special case hex constants. These will look like
|
||||
* identifiers starting with 'x' or 'X' but preceded
|
||||
* with '0'
|
||||
*/
|
||||
|
||||
if (ident_index < 1 ||
|
||||
(line[ident_index] != 'x' && line[ident_index] != 'X') ||
|
||||
line[ident_index - 1] != '0')
|
||||
{
|
||||
/* REVISIT: Although pre-processor definitions are
|
||||
* supposed to be all upper-case, there are exceptions
|
||||
@ -1281,11 +1272,31 @@ int main(int argc, char **argv, char **envp)
|
||||
* considered false alarms.
|
||||
*/
|
||||
|
||||
ERROR("Mixed case identifier found", lineno, ident_index);
|
||||
/* Ignore inttype.h strings beginning with PRIx */
|
||||
|
||||
if (ident_index >= 4 &&
|
||||
(strncmp(&line[ident_index], "PRIx", 4) == 0))
|
||||
{
|
||||
/* No error */
|
||||
}
|
||||
|
||||
/* Special case hex constants. These will look like
|
||||
* identifiers starting with 'x' or 'X' but preceded
|
||||
* with '0'
|
||||
*/
|
||||
|
||||
else if (ident_index < 1 ||
|
||||
(line[ident_index] != 'x' &&
|
||||
line[ident_index] != 'X') ||
|
||||
line[ident_index - 1] != '0')
|
||||
{
|
||||
ERROR("Mixed case identifier found",
|
||||
lineno, ident_index);
|
||||
}
|
||||
else if (have_upper)
|
||||
{
|
||||
ERROR("Upper case hex constant found", lineno, ident_index);
|
||||
ERROR("Upper case hex constant found",
|
||||
lineno, ident_index);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user