mirror of
https://github.com/github/codeql.git
synced 2026-04-30 03:05:15 +02:00
Merge pull request #1223 from geoffw0/commentedoutcode
CPP: Detect commented out preprocessor logic
This commit is contained in:
@@ -1,6 +1,13 @@
|
||||
| test2.cpp:37:1:37:39 | // int myFunction() { return myValue; } | This comment appears to contain commented-out code |
|
||||
| test2.cpp:39:1:39:45 | // int myFunction() const { return myValue; } | This comment appears to contain commented-out code |
|
||||
| test2.cpp:41:1:41:54 | // int myFunction() const noexcept { return myValue; } | This comment appears to contain commented-out code |
|
||||
| test2.cpp:43:1:43:18 | // #define MYMACRO | This comment appears to contain commented-out code |
|
||||
| test2.cpp:45:1:45:23 | // #include "include.h" | This comment appears to contain commented-out code |
|
||||
| test2.cpp:47:1:51:2 | /*\n#ifdef\nvoid myFunction();\n#endif\n*/ | This comment appears to contain commented-out code |
|
||||
| test2.cpp:59:1:59:24 | // #if(defined(MYMACRO)) | This comment appears to contain commented-out code |
|
||||
| test2.cpp:63:1:63:15 | // #pragma once | This comment appears to contain commented-out code |
|
||||
| test2.cpp:65:1:65:17 | // # pragma once | This comment appears to contain commented-out code |
|
||||
| test2.cpp:67:1:67:19 | /*#error"myerror"*/ | This comment appears to contain commented-out code |
|
||||
| test.c:2:1:2:22 | // commented out code; | This comment appears to contain commented-out code |
|
||||
| test.c:4:1:7:8 | // some; | This comment appears to contain commented-out code |
|
||||
| test.c:9:1:13:8 | // also; | This comment appears to contain commented-out code |
|
||||
|
||||
@@ -39,3 +39,29 @@
|
||||
// int myFunction() const { return myValue; }
|
||||
|
||||
// int myFunction() const noexcept { return myValue; }
|
||||
|
||||
// #define MYMACRO
|
||||
|
||||
// #include "include.h"
|
||||
|
||||
/*
|
||||
#ifdef
|
||||
void myFunction();
|
||||
#endif
|
||||
*/
|
||||
|
||||
// define some constants
|
||||
|
||||
// don't #include anything here
|
||||
|
||||
// #hashtag
|
||||
|
||||
// #if(defined(MYMACRO))
|
||||
|
||||
// #iffy
|
||||
|
||||
// #pragma once
|
||||
|
||||
// # pragma once
|
||||
|
||||
/*#error"myerror"*/
|
||||
|
||||
Reference in New Issue
Block a user