Review Request: Make C macro variadic argument optional

Milian Wolff mail at milianw.de
Mon Jul 16 19:44:22 UTC 2012



> On June 20, 2012, 1:52 p.m., Alexandre Courbot wrote:
> > FYI 8 of the tests in testPreprocessor() were failing before this patch. The test added also fails because variadic arguments are not correctly expanded in the first place.
> 
> Milian Wolff wrote:
>     locally I don't have any failing tests - so please take a look at that again.
> 
> Alexandre Courbot wrote:
>     Milian, sorry for the late reply. Here is the result of testPreprocessor on today's master branch:
>     
>     ./parsertest testPreprocessor
>     ********* Start testing of TestParser *********
>     Config: Using QTest library 4.8.2, Qt 4.8.2
>     QWARN  : TestParser::initTestCase() WARNING: deleting stale lockfile /home/gnurou/.kde4/share/apps/kdevplatform/sessions//{e67c062e-a374-42c2-a842-fce5a902a3c2}/lock
>     QWARN  : TestParser::initTestCase() WARNING: deleting stale lockfile /home/gnurou/.kdevduchain/{e67c062e-a374-42c2-a842-fce5a902a3c2}/0/lock
>     QDEBUG : TestParser::initTestCase() kdevplatform(32374)/kdevplatform (language) KDevelop::ItemRepositoryRegistry::open: version-hint not found, seems to be an old version 
>     QDEBUG : TestParser::initTestCase() kdevplatform(32374)/kdevplatform (language) KDevelop::ItemRepositoryRegistry::open: "The data-repository at /home/gnurou/.kdevduchain/{e67c062e-a374-42c2-a842-fce5a902a3c2}/0 has to be cleared." 
>     PASS   : TestParser::initTestCase()
>     XFAIL  : TestParser::testPreprocessor() Backslash incorrectly handled
>        Loc: [/home/gnurou/Work/KDE/kdevelop/languages/cpp/parser/tests/test_parser.cpp(509)]
>     XFAIL  : TestParser::testPreprocessor() Backslash incorrectly handled
>        Loc: [/home/gnurou/Work/KDE/kdevelop/languages/cpp/parser/tests/test_parser.cpp(512)]
>     XFAIL  : TestParser::testPreprocessor() Empty expansions incorrectly handled
>        Loc: [/home/gnurou/Work/KDE/kdevelop/languages/cpp/parser/tests/test_parser.cpp(515)]
>     XFAIL  : TestParser::testPreprocessor() Variadic macros unsupported
>        Loc: [/home/gnurou/Work/KDE/kdevelop/languages/cpp/parser/tests/test_parser.cpp(518)]
>     XFAIL  : TestParser::testPreprocessor() Variadic macros unsupported
>        Loc: [/home/gnurou/Work/KDE/kdevelop/languages/cpp/parser/tests/test_parser.cpp(521)]
>     XFAIL  : TestParser::testPreprocessor() No problems reported for missmatching macro-parameter-lists
>        Loc: [/home/gnurou/Work/KDE/kdevelop/languages/cpp/parser/tests/test_parser.cpp(524)]
>     XFAIL  : TestParser::testPreprocessor() No problems reported for missmatching macro-parameter-lists
>        Loc: [/home/gnurou/Work/KDE/kdevelop/languages/cpp/parser/tests/test_parser.cpp(527)]
>     XFAIL  : TestParser::testPreprocessor() No problems reported for macro-redefinition
>        Loc: [/home/gnurou/Work/KDE/kdevelop/languages/cpp/parser/tests/test_parser.cpp(530)]
>     PASS   : TestParser::testPreprocessor()
>     PASS   : TestParser::cleanupTestCase()
>     Totals: 3 passed, 0 failed, 0 skipped
>     ********* Finished testing of TestParser *********
>     
>     As you can see some errors are indeed triggered, even though no test is mentionned as failed in the end.

XFAIL means expected fail, which means this is OK. only pure "FAIL" is a big issue, anything else is just more of a TODO hint.


- Milian


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/105307/#review14911
-----------------------------------------------------------


On June 20, 2012, 1:51 p.m., Alexandre Courbot wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/105307/
> -----------------------------------------------------------
> 
> (Updated June 20, 2012, 1:51 p.m.)
> 
> 
> Review request for KDevelop.
> 
> 
> Description
> -------
> 
> In GNU C, the variadic argument of a macro can be completely left out
> without triggering an error (as explained in
> http://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html)
> 
> 
> Diffs
> -----
> 
>   languages/cpp/parser/rpp/pp-engine.cpp ca566cb 
>   languages/cpp/parser/tests/test_parser.cpp 804f379 
> 
> Diff: http://git.reviewboard.kde.org/r/105307/diff/
> 
> 
> Testing
> -------
> 
> Checked that the faulty case was not triggering a parsing error anymore. Checked that no regression was introduced in the testPreprocessor() test case.
> 
> 
> Thanks,
> 
> Alexandre Courbot
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20120716/5e3b8480/attachment.html>


More information about the KDevelop-devel mailing list