Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nxstyle: Suppress checking in strings/comments. #387

Open
patacongo opened this issue Feb 26, 2020 · 0 comments
Open

nxstyle: Suppress checking in strings/comments. #387

patacongo opened this issue Feb 26, 2020 · 0 comments
Labels
Type: Bug Something isn't working

Comments

@patacongo
Copy link
Contributor

patacongo commented Feb 26, 2020

nxstyle does not detect when it is within a string and will report crazy things because it is parsing the strng content. For example, if the string contains "Hello", nxstyle would probleam complain about mixed case identifiers, if the strong contains "https://", it would probably complete about C++ style comments. If the string contains "yes/no" it would probably complain about missing spaces before and after an operator.

Below is a even more obsure false alarm example:

junk.c:

/****************************************************************************
 * Private Data
 ****************************************************************************/

static const char g_blabber[] = "Yadda, yadda, yadda, yadda";

/****************************************************************************
* Public Functions
****************************************************************************/

then you see:

$ tools/nxstyle.exe junk.c
junk.c:5:39: error: Multiple data definitions

In this case, nxstyle should ignore the ',' characters is within a string.

Most of this also applies to comments. You will see the same kinds of errors for similer sub-strings within a comment. nxstyle does detect that it is within a comment, however, it does not use that information to suppress certain error reports.

@patacongo patacongo added the Type: Bug Something isn't working label Mar 5, 2020
yamt added a commit to yamt/incubator-nuttx that referenced this issue Nov 25, 2020
The following nxstyle error is a false positive.
apache#387

fs/nfs/nfs_util.c:70:39: error: C++ style comment
yamt added a commit to yamt/incubator-nuttx that referenced this issue Nov 25, 2020
The following nxstyle error is a false positive.
apache#387

fs/nfs/nfs_util.c:70:39: error: C++ style comment
xiaoxiang781216 pushed a commit that referenced this issue Nov 25, 2020
The following nxstyle error is a false positive.
#387

fs/nfs/nfs_util.c:70:39: error: C++ style comment
yamt added a commit to yamt/incubator-nuttx-apps that referenced this issue May 7, 2021
The following errors are false positives.
apache/nuttx#387

```
/Users/yamamoto/git/nuttx/apps/netutils/netlib/netlib_parseurl.c:57:13: error: C++ style comment
/Users/yamamoto/git/nuttx/apps/netutils/netlib/netlib_parseurl.c:59:35: error: C++ style comment
```
xiaoxiang781216 pushed a commit to apache/nuttx-apps that referenced this issue May 8, 2021
The following errors are false positives.
apache/nuttx#387

```
/Users/yamamoto/git/nuttx/apps/netutils/netlib/netlib_parseurl.c:57:13: error: C++ style comment
/Users/yamamoto/git/nuttx/apps/netutils/netlib/netlib_parseurl.c:59:35: error: C++ style comment
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant