GeezerVison is showing github.com — Skip C++-specific warnings for C code · Issue #71 · cpplint/cpplint
Skip C++-specific warnings for C code #71DescriptionFor source code files with .[cChH] extension, please skip warnings meant for C++ code, so that programmers don't accidentally introduce C++-isms into their C code.
Example: readability/casting and runtime/int should be disabled for C code.
As a workaround, I am disabling these rules regardless of the source language, so that I can run cpplint more reliably across my C, C++, and mixed C/C++ projects. Activitytkruse commented on Jan 11, 2019 mcandre commented on Jan 18, 2019 tkruse commented on Jan 19, 2019 I did not know the code already had a mechanism. In that case, we can deal with it in this repo, I think.
Still might be good to send a patch of changes upstream (note to myself). carlocorradini commented on Jul 17, 2023 Hey, any update on this? It's really annoying seeing C++ warnings in a C project :/
Thanks 😊 aaronliu0130 commented on Jan 26, 2024 It seems like the heuristic to detect C files (https://github.com/cpplint/cpplint/blob/e3482c5/cpplint.py#L851) hunts the file's contents in a mode similar to "match whole words" to check if it contains "LINT_C_FILE" or a vim declaration that the file is a C file. So the current workaround would be to add // LINT_C_FILE somewhere in the file. You could also do --extensions=cc, --exclude=*.c or something of the sort. aaronliu0130 commented on Jan 26, 2024 added a commit that references this issue on Mar 25, 2025This issue will close once commit 75d2d99 is merged into the 'crytown' branch.75d2d99
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|