JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.
If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.
If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.
| CodeSonar® 9.2p0 | CONFIDENTIAL | CodeSecure Inc |
A token cannot be parsed correctly because the parser encountered an unexpected character.
The C and C++ standards each specify sets of characters that may appear in identifiers and other tokens. Your compiler may also permit additional characters.
This warning class is derived from a C/C++ parser warning.
| Class Name | Bad Token | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Significance | style | |||||||||
| Mnemonic | PARSE.BAD.TOKEN | |||||||||
| Categories |
|
|||||||||
| Availability | Available for C and C++. |
|||||||||
| Enabling | Checks for this warning class are
disabled by default. To enable them, add the following WARNING_FILTER
rule to the project configuration file.
WARNING_FILTER += allow class="Bad Token" |
#include <stdio.h> /* The code in this file will typically cause compiler errors. */ int parse_bad_token(int num) { int €premium = 5; /* € permitted in identifiers from C11 */ int total = 0¥; /* 'Bad Token' warning issued here for token ¥ */ int cost_£_beforetax = 5; /* 'Bad Token' warning issued here for token £_beforetax */ int £tax = 1; /* 'Bad Token' warning issued here for token £tax */ int total = num * (cost_£_beforetax + £tax); /* Three warnings issued here: * - 'Bad Token' warning for token £tax * - 'Bad Token' warning for token £_beforetax * - 'Uninitialized Variable' warning for variable cost_ */ printf("Computing cost including £tax"); /* No warning for "£tax" in string literal (or comment). */ return total + €premium; }
The following configuration file parameters affect checks for this warning class.
To report problems with this documentation, please visit https://support.codesecure.com/.