Commit Graph

270 Commits

Author SHA1 Message Date
Daniel Marjamäki 46b19e0184 Preprocessor: Refactoring to make it simpler 2009-12-06 19:17:59 +01:00
Daniel Marjamäki 7616246597 Fixed #1014 (Preprocessor: Invalid preprocessing of '#define some_delete(x) delete x;') 2009-11-26 17:32:18 +01:00
Daniel Marjamäki 092f64b77a Fixed #982 (Preprocessor: detects and remove conditions which always true) 2009-11-21 19:53:07 +01:00
Daniel Marjamäki 7890589693 Fixed #912 (### Unlogged error at Tokenizer::syntaxError: Invalid number of character (()) 2009-11-20 19:18:57 +01:00
Reijo Tomperi 7ddc4f4e02 Fix #971 (Preprocessor: Handle partial macro in macro)
http://sourceforge.net/apps/trac/cppcheck/ticket/971
2009-11-19 00:34:00 +02:00
Reijo Tomperi 8f07e2711c Added a few TODO test cases for #971 (Invalid number of characters (())
http://sourceforge.net/apps/trac/cppcheck/ticket/971
2009-11-18 00:21:21 +02:00
Daniel Marjamäki a36c410d45 Preprocessor: When #error is encountered the result is an empty string => don't check configuration 2009-11-13 22:12:29 +01:00
Daniel Marjamäki 169bcfcff2 Fixed #882 (false positive: uninitialized variable) 2009-11-02 18:31:22 +01:00
Daniel Marjamäki 09859c1019 refactoring the folder structure 2009-10-25 12:49:06 +01:00
Daniel Marjamäki 91de8f399b Fixed #821 (Preprocessor: Wrong stringification in macros) 2009-10-14 20:40:17 +02:00
Reijo Tomperi ea36632ca3 Fix #808 (Segfault in Preprocessor)
http://sourceforge.net/apps/trac/cppcheck/ticket/808
2009-10-10 23:23:48 +03:00
Reijo Tomperi 272f0d3be5 Fix #795 (Preprocessor: Incorrect handling of #if (A) || (B))
http://sourceforge.net/apps/trac/cppcheck/ticket/795
2009-10-06 11:47:36 +03:00
Daniel Marjamäki ab18f1bd3c Preprocessor: Minor fixes (#772) 2009-10-04 15:41:50 +02:00
Daniel Marjamäki 1a48f869c8 Fixed #772 (Preprocessor: #if(A) is not seen equal to #if A) 2009-10-04 07:25:30 +02:00
Reijo Tomperi fdde2182b9 Fix GPL comments in all files. ">." was missing from the end. 2009-09-27 18:08:31 +03:00
Reijo Tomperi 4d2a8608a8 Fix #706 (false positive: invalid number of character ((), can't process file)
http://sourceforge.net/apps/trac/cppcheck/ticket/706
2009-09-21 23:27:06 +03:00
Reijo Tomperi 003e27c10e Fix #667 (Preprocessor does not handle macro inside macro correctly)
http://sourceforge.net/apps/trac/cppcheck/ticket/667
2009-09-20 00:09:05 +03:00
Reijo Tomperi 92b8593f59 TODO test case for preprocessor macro handling 2009-09-14 22:53:57 +03:00
Daniel Marjamäki 37dae83e06 More Fixing of #635 (Preprocessor: remove 'asm(...)') 2009-09-11 23:34:24 +02:00
Daniel Marjamäki 8837e0dcff Simple fix for #635 (preprocessor: remove 'asm(...)') 2009-09-11 21:22:41 +02:00
Daniel Marjamäki c9449f9bd0 Preprocessor: Added a todo testcase 2009-08-31 20:36:25 +02:00
Reijo Tomperi e1cdbf3c5a Fix ticket #611 (Preprocessor: the configurations "A;B" and "B;A" are the same)
http://sourceforge.net/apps/trac/cppcheck/ticket/611
2009-08-30 00:00:54 +03:00
Daniel Marjamäki ff9ed1d7aa Preprocessor: better handling of pragma asm and pragma endasm 2009-08-26 21:54:43 +02:00
Daniel Marjamäki 724d6bf53a Fixed #507 (Preprocessor: Incorrect expanding of inner macros) 2009-08-22 13:03:52 +02:00
Reijo Tomperi 7d44ce7736 Fix ticket #598 (Preprocessor: Multiline comments add line change to wrong location)
http://sourceforge.net/apps/trac/cppcheck/ticket/598
2009-08-20 00:27:47 +03:00
Reijo Tomperi c8da301f83 fix ticket #586 (Preprocessor: Lines like "#error don't" can cause "no pair for character" errors)
http://sourceforge.net/apps/trac/cppcheck/ticket/586
2009-08-14 00:22:51 +03:00
Daniel Marjamäki bcab694a74 preprocessor: added todo testcase for detecting redundant preprocessor conditions 2009-08-12 20:28:43 +02:00
Daniel Marjamäki 045b73c7ec Fixed #582 (Preprocessor: Remove assembler code inside pragmas) 2009-08-10 20:07:55 +02:00
Daniel Marjamäki b5d172b6e9 preprocessor: fixed problem in Preprocessor::expandMacros when macro argument is for example 'unsigned long' 2009-08-01 14:55:45 +02:00
Daniel Marjamäki d06e669017 Preprocessor: Speedup of the match_cfg_def function 2009-07-30 10:10:34 +02:00
Reijo Tomperi a07b7635c0 Fix ticket #265 (Log a warning when an include file is not found)
http://sourceforge.net/apps/trac/cppcheck/ticket/265
2009-07-25 22:10:30 +03:00
Daniel Marjamäki b172d62cae Added more tests to the TestPreprocessor::match_cfg_def (#505) 2009-07-25 17:04:13 +02:00
Daniel Marjamäki f877cd2db1 Preprocessor: Added todo test case for better evaluation of #if conditions 2009-07-25 16:22:42 +02:00
Daniel Marjamäki dacaff824c Fixed #501 (Preprocessor should read open configurations that are defined within the file) 2009-07-25 13:58:34 +02:00
Daniel Marjamäki 9b2dd8c7eb Preprocessor: Better evaluation of conditions such as '#if defined A || defined B' (#469) 2009-07-22 20:11:27 +02:00
Daniel Marjamäki 6fecd858e3 Fixed #469 (Preprocessor should read open configurations that are defined within the file) 2009-07-22 18:47:50 +02:00
Daniel Marjamäki 17008879ac minor refactoring: header cleanup. use forward declarations instead of includes 2009-07-13 19:11:31 +02:00
Reijo Tomperi 8b0e481d46 Refactoring: Rename member functions to follow naming guidelines. 2009-07-05 23:16:43 +03:00
Daniel Marjamäki 7ec8e2396f Fix ticket #267 (Glued define and define name in output text)
The handling of ifdef configurations where rewritten. Either a
configuration is handled properly or it is not handled at all.
2009-06-26 13:19:55 +02:00
Daniel Marjamäki a0ba52ccf1 Preprocessor: Replace "#if !defined(A)" with "#ifndef A" 2009-06-21 08:03:42 +02:00
Daniel Marjamäki 6e1281ec34 Preprocessor: Better handling of macros that has parantheses but not parameters such as "#define AAA( ) aaa" 2009-06-19 16:42:47 +02:00
Daniel Marjamäki 58c7414ce0 Fixed ticket #417 (Crashes in windows because of invalid char value)
negative char values are allowed in strings and comments. but not in other code.
2009-06-19 15:43:46 +02:00
Kimmo Varis 3da3c74f6f Revert "Fix ticket #417 (Crashes in Windows because of invalid char value)"
This reverts commit 70db2562f4.

See the ticket - the fix was not correct fix.
2009-06-19 10:20:15 +03:00
Kimmo Varis 1619b6cb0f Merge branch 'master' of git@github.com:danmar/cppcheck 2009-06-19 00:11:17 +03:00
Daniel Marjamäki 12f3ac5a2f Preprocessor: better handling of "..." and "__VA_ARGS__" in macros 2009-06-18 23:09:11 +02:00
Kimmo Varis 70db2562f4 Fix ticket #417 (Crashes in Windows because of invalid char value)
8-bit characters and UTF-8 characters are now converted to spaces. They can only appear in the code files in comments or string/char constants. So we cannot just ignore them as that would change length.
2009-06-19 00:09:05 +03:00
Reijo Tomperi 7c4423889c Fixed ticket #405 (#ifdef A and #if defined A should be handled as same configuration)
http://sourceforge.net/apps/trac/cppcheck/ticket/405
2009-06-14 23:37:18 +03:00
Slava Semushin 084b3c002f Fixed ticket #403 (false positive::Array index out of range)
http://sourceforge.net/apps/trac/cppcheck/ticket/403
2009-06-14 11:21:20 +07:00
Reijo Tomperi 90b786b09c Fix ticket #353 (No pair for character (').)
http://apps.sourceforge.net/trac/cppcheck/ticket/353
2009-06-05 23:45:31 +03:00
Reijo Tomperi 58eda6e978 Fix ticket #325 (Replace developer names in source files with AUTHORS file)
http://apps.sourceforge.net/trac/cppcheck/ticket/325
2009-05-30 08:48:12 +03:00
Reijo Tomperi 977e31786d Fix ticket #332 (White space between macro name and '(' causes macro simplification to fail)
http://apps.sourceforge.net/trac/cppcheck/ticket/332
2009-05-24 23:57:12 +03:00
Reijo Tomperi bbf63b7970 Fix ticket #304 (#include <file.h> should be searched from paths given with -I parameter.)
http://apps.sourceforge.net/trac/cppcheck/ticket/304
Note that the ticket is same as with previous commit, but task description was changed a little.
2009-05-23 00:18:48 +03:00
Reijo Tomperi 93d9400f63 Fix ticket #304 (#include <file.h> should be parsed like #include "file.h" is being parsed)
http://apps.sourceforge.net/trac/cppcheck/ticket/304
2009-05-22 23:59:07 +03:00
Reijo Tomperi bb2b2e000b Fix ticket #316 (\n is tokenized into \\ in a string when macro is used)
http://apps.sourceforge.net/trac/cppcheck/ticket/316
2009-05-20 21:36:59 +03:00
Reijo Tomperi a3f469d339 Fix ticket #315 (Segmentation fault when checking Linux kernel) (previous fix was only partial fix)
http://apps.sourceforge.net/trac/cppcheck/ticket/315
2009-05-19 22:19:15 +03:00
Reijo Tomperi d6d55c2db4 Fix ticket #315 (Segmentation fault when checking Linux kernel)
http://apps.sourceforge.net/trac/cppcheck/ticket/315
2009-05-18 23:32:04 +03:00
Daniel Marjamäki 2bd80a7335 Fix for ticket 291 - preprocessor: better handling of defines
http://apps.sourceforge.net/trac/cppcheck/ticket/291
2009-05-17 18:51:29 +02:00
Reijo Tomperi 36cdac1b96 Fix ticket #312 (division by pointer value causes wrong tokenizing)
http://apps.sourceforge.net/trac/cppcheck/ticket/312
2009-05-14 22:53:49 +03:00
Daniel Marjamäki 2508f3c721 Preprocessor: Added test case for #291. One of the assertions is a TODO and it should be fixed.
http://apps.sourceforge.net/trac/cppcheck/ticket/291
2009-05-13 21:38:57 +02:00
Reijo Tomperi e5e82274dc Fix ticket #306 (Invalid multi-line comment produces cryptic internal error)
http://apps.sourceforge.net/trac/cppcheck/ticket/306
2009-05-13 22:18:02 +03:00
Reijo Tomperi 997a784bb6 Added TODO test case TestPreprocessor::multiline_comment
Made tokenizer to printout token list in case of syntax error, if debug is used
2009-05-13 00:01:53 +03:00
Reijo Tomperi fede702bf5 Fix ticket #302 (White space between "\" and newline not handled correctly)
http://apps.sourceforge.net/trac/cppcheck/ticket/302
2009-05-11 21:12:29 +03:00
Reijo Tomperi 63da926ed2 Fix ticket #294 (### Error: Invalid number of character ()
http://apps.sourceforge.net/trac/cppcheck/ticket/294
2009-05-09 22:32:29 +03:00
Daniel Marjamäki fd0e592767 Preprocessor: Handling newlines when using # to stringify parameters (#281) 2009-05-05 17:19:06 +02:00
Daniel Marjamäki 67eb54c4c0 Merge branch 'abc' 2009-04-27 21:29:29 +02:00
Daniel Marjamäki b49997e69d bail out instead of crash when parsing unicode code (#207) 2009-04-27 21:29:03 +02:00
Reijo Tomperi d8f6636673 Improve fix to ticket #261: Allow macro definition to have uncoupled double quote.
http://apps.sourceforge.net/trac/cppcheck/ticket/261
2009-04-26 22:19:08 +03:00
Daniel Marjamäki 7b58e09a07 Preprocessor: Report correct file and line in message 'No pair for character..' (#261) 2009-04-26 11:05:32 +02:00
Reijo Tomperi 07af9cf7c8 astyle fix 2009-04-03 22:10:27 +03:00
Reijo Tomperi 7a11f0e61f Fix ticket #242 (Preprocessor: Bail out on failure instead of terminating the program)
http://apps.sourceforge.net/trac/cppcheck/ticket/242
2009-04-03 22:09:12 +03:00
Reijo Tomperi ca055dc830 Fix ticket #191 (semicolon after #endif stop tokenizing of function)
http://apps.sourceforge.net/trac/cppcheck/ticket/191
2009-03-18 01:10:26 +02:00
Reijo Tomperi c413c8d4b3 Fix ticket #179 (preprocessor issues)
http://apps.sourceforge.net/trac/cppcheck/ticket/179
2009-03-16 23:20:55 +02:00
Reijo Tomperi 1c74978a92 test case stringify3 added 2009-03-15 23:39:58 +02:00
Reijo Tomperi 21b687b301 Improved tokenizer to handle '#' better. Previously everything after # was combined into a single token,
now # is considered more like an alphabet, with few exceptions, e.g. "##" tokens.
2009-03-15 23:09:27 +02:00
Reijo Tomperi b26955b9f8 Test case stringify2() added. 2009-03-15 16:05:23 +02:00
Reijo Tomperi bb3316a45b Fix ticket #181 (#pragma causes wrong line numbers)
http://apps.sourceforge.net/trac/cppcheck/ticket/181
2009-03-15 14:23:12 +02:00
Reijo Tomperi 657495b825 astyle fix 2009-03-11 00:49:16 +02:00
Daniel Marjamäki cd54a0ed3b Fixed ticket 147 (Invalid line number for error message) 2009-03-09 20:29:25 +01:00
Reijo Tomperi 1c626c53c2 Added test case for #147 (Invalid line number for error message)
http://apps.sourceforge.net/trac/cppcheck/ticket/147
macro_linenumbers() in test/testpreprocessor.cpp
2009-03-08 22:28:12 +02:00
Reijo Tomperi 765da17132 Astyle fix 2009-03-08 09:49:04 +02:00
Reijo Tomperi 5be85d71a0 Fix ticket #145 (Line numbers are invalid if file is included inside #ifdef)
http://apps.sourceforge.net/trac/cppcheck/ticket/145
2009-03-08 09:45:53 +02:00
Reijo Tomperi fc8f47145a Copyrights updated 2009-03-01 19:52:33 +00:00
Leandro Penz de80baeea1 Preprocessor: support for ##-comma-eating in variadic macros; passing now fmt2 test. 2009-02-13 13:34:24 +00:00
Leandro Penz d511863b57 Preprocessor: initial variadic macro support; passing now on fmt1 case. 2009-02-13 13:31:40 +00:00
Reijo Tomperi d48671bdfb Fixed more of ticket #81 (getting rid of compiler warnings) 2009-02-07 20:55:25 +00:00
Reijo Tomperi b211b8cbe8 Fix ticket #84 (unit testing: use "protected" instead of preprocessor) 2009-02-07 20:06:00 +00:00
Daniel Marjamäki e9d19840d2 preprocessor: Added testcase fmt2 that is commented out because it doesn't work yet 2009-01-28 20:19:46 +00:00
Daniel Marjamäki bada255c80 testpreprocessor: removed unused test case 2009-01-25 19:18:18 +00:00
Daniel Marjamäki 9c51729be6 preprocessor: stringify macros 2009-01-25 13:30:15 +00:00
Daniel Marjamäki 5acc6aca31 preprocessor: insert space. '#if(' => '#if (' 2009-01-24 19:28:30 +00:00
Reijo Tomperi 98d7f02ebc Added test case preprocessor_and_operation for ticket #55 (also fixed style from previous commit) 2009-01-24 18:50:09 +00:00
Daniel Marjamäki 193cffdb0b preprocessor: fixed bug with mixed macros ABC and ABCD 2009-01-23 17:14:42 +00:00
Daniel Marjamäki 67e4ea10c9 preprocessor: handle redefinition of macro 2009-01-22 20:19:07 +00:00
Daniel Marjamäki a9e84c5cd5 preprocessor: handle include guards by not checking for configurations in header files 2009-01-22 18:19:17 +00:00
Nicolas Le Cam b7e4f1319c Fix Preprocessor::read to handle char constant of more than one char, fixing issue #45; Fix the test that handle the case. 2009-01-21 21:45:17 +00:00
Reijo Tomperi 53d02c0804 Fix Ticket #43, preprocessor: include file doesn't work so good in subfolders (note, because of other issues, checking will be very slow now
that this is fixed)
2009-01-21 21:03:46 +00:00
Reijo Tomperi 176dd41306 Fixed Ticket #40, Check copyright texts in files, now that we have new developers. 2009-01-21 20:04:20 +00:00
Reijo Tomperi 9f63e2227b Added test case multi_character_character 2009-01-21 19:12:28 +00:00
Daniel Marjamäki 76cb2310af preprocessor: handled problem with parsing strings when expanding macros 2009-01-21 17:11:24 +00:00
Daniel Marjamäki 1622922384 preprocessor: Added todo test. It crashes when it's used 2009-01-21 07:22:44 +00:00
Daniel Marjamäki d82314b365 preprocessor: Handle ## 2009-01-20 18:28:24 +00:00
Reijo Tomperi df5adc5f4f Added test case preprocessor_doublesharp, executed ./runastyle for errormessage.h 2009-01-19 21:45:59 +00:00
Reijo Tomperi 4d0e3dac45 Added a test case and fixed bug. If #include was inside a string, cppcheck hanged in preprocessor. 2009-01-19 19:24:41 +00:00
Daniel Marjamäki a9851f44c1 testpreprocessor: Removed test that doesn't work now that the preprocessor handles includes 2009-01-19 16:42:20 +00:00
Daniel Marjamäki c7311b4b3c preprocessor: make sure macros are not expanded when they are found in strings 2009-01-18 16:58:57 +00:00
Daniel Marjamäki 965daabe60 preprocessor: Make sure that "#define ABC (a+b+c)" is expanded correctly 2009-01-18 16:56:12 +00:00
Daniel Marjamäki ea686a1da9 preprocessor: fixed so the TestPreprocessor::preprocessor_undef succeeds 2009-01-18 16:37:40 +00:00
Daniel Marjamäki 4ee4645858 Preprocessor: Reverted [1008] - The old expandMacros was readded 2009-01-18 10:54:07 +00:00
Daniel Marjamäki 86c95c27d2 Preprocessor: Removed "Preprocessor::expandMacros" and commented all its tests 2009-01-18 07:32:06 +00:00
Daniel Marjamäki c1a4e9b000 testpreprocessor: commented the "undef" test that doesn't work 2009-01-12 19:23:01 +00:00
Reijo Tomperi ee54d4da91 Added test case which currently fails, #undef is not handled 2009-01-12 18:23:53 +00:00
Daniel Marjamäki 153487d504 preprocessor: Style updates 2009-01-12 06:43:56 +00:00
Daniel Marjamäki eb8675ab76 preprocessor: Handle newlines better 2009-01-12 06:33:06 +00:00
Daniel Marjamäki ea6c48b2bd preprocessor: fixed a small bug when expanding macro without parameter 2009-01-11 16:06:37 +00:00
Daniel Marjamäki da881fdd0a preprocessor: Fixed bug when expanding macros without parameters 2009-01-11 15:51:46 +00:00
Daniel Marjamäki ecdfee850d preprocessor: expand macro without parameters 2009-01-11 15:07:13 +00:00
Daniel Marjamäki e42953bd3b preprocessor: Added a test to see that "<backslash><newline>" is handled correctly inside strings 2009-01-11 08:16:15 +00:00
Daniel Marjamäki 94667320e8 preprocessor: Handle "<backslash><newline>" better 2009-01-11 07:19:28 +00:00
Reijo Tomperi c7730044c7 Added test case for preprocessor which currently fails. codeblocks project file updated, tools-files added. 2009-01-08 22:28:54 +00:00
Reijo Tomperi e435a1f1d6 Refactoring: Added src/ and test/ folders. Moved source files to those folders, updated makefile and codeblocks project file. 2009-01-06 14:18:36 +00:00