Version: CVS (using KDE KDE 3.1) Installed from: RedHat RPMs Editor flags a syntax error on 'foreach_s' in C code. List macros like this are all over the kernel source. #define foreach_s(ptr, t, list) \ for(ptr=(list)->next,t=(ptr)->next; list != ptr; ptr=t, t=(t)->next) static void free_funcs( struct dynfn *l ) { struct dynfn *f, *tmp; foreach_s (f, tmp, l) { remove_from_list( f ); ALIGN_FREE( f->code ); FREE( f ); } }
Note that you added a space between the macro and the parenthesis. It might be the cause.
This was tested in three diferent machines: Mine, Roberto's and Jens's It worked fine in all of them, with or without the space. Please provide some more info!
I should have added the the #define is in an include file. Adding it to the C file clears the error. The project is makefile based without automake. Does the problem reporter parse include files? How does it find the path to them on a makefile project? Should the problem report flag include files that it's can't locate?
*** Bug 60766 has been marked as a duplicate of this bug. ***
here's another example (removed safeguards for simplicity): -- bug.h -- #define BUG_ATTRIBUTES __attribute__ ((noreturn, format (printf, 1, 2))) void bug(const char *fmt, ...) BUG_ATTRIBUTES; -- -- bug.c -- #include "bug.h" void bug(const char *fmt, ...) BUG_ATTRIBUTES { // <-- Syntax Error reported } --
Another try ... > bug.h #define BUG_ATTRIBUTES __attribute__ ((noreturn, format (printf, 1, 2))) void bug(const char *fmt, ...) BUG_ATTRIBUTES; > bug.c #include "bug.h" void bug(const char *fmt, ...) BUG_ATTRIBUTES { // <-- Syntax Error reported }
Another example is wxWidgets. It heavily uses macros, for instance to declare the event table, or the app etc. (very MFCish way). KDevelop even has wxWidgets templates, but isn't able to parse them correctly. <Example: dlg.h> // include wxWidgets includes class DlgAbout : public wxDialog { public: CDlgAbout( wxWindow *pParent ); ~CDlgAbout(); private: DECLARE_EVENT_TABLE() // XXX }; </Example> The line marked with XXX always gives an error with the result, that the whole class does not appear in the class view, which makes KDevelop almost unusable with wxWidgets. It seems KDevelop wants a semi-colon ';', but if I add it I cannot compile anymore.
*** Bug 101179 has been marked as a duplicate of this bug. ***
This still occurs in version 3.2.2 and renders WxWidgets unusable with Kdevelop.
Problem is with the parser, not the Problems display widget.
I believe we've delt with this problem as much as we reasonably can in KDevelop3. See comment #3 in bug #132643. *** This bug has been marked as a duplicate of 132643 ***
Moving all the bugs from the CPP Parser. It was not well defined the difference between it and C++ Language Support and people kept reporting in both places indistinctively