Fwd: Jump to compilation errors file:N:0 doesn't work

Morten Volden mvolden2 at gmail.com
Fri Jan 27 20:39:42 UTC 2017


2017-01-26 15:01 GMT+04:00 Aleksey Midenkov <midenok at gmail.com>:

> F.ex. jump to:
>
> /home/midenok/src/mariadb/midenok/src/sql/partitioning/parti
> tion_handler.h:60:0:
> warning: "HA_FAST_CHANGE_PARTITION" redefined
>
> doesn't work. It opens file, but doesn't jump to line 60.
>
> Thoug it works very well for lines like this:
>
> /home/midenok/src/mariadb/midenok/src/sql/partitioning/parti
> tion_handler.h:34:41:
> error: conflicting declaration 'typedef struct
> st_ha_create_information HA_CREATE_INFO'
>
> Are you aware of this bug?
>

Actually I think the bug is in g++.

Consider this code (Where all lines start at the leftmost column i.e.
column ONE):

int main(int argc, char **argv) {
#define MVOTEST hello
#define MVOTEST hi
fffffff
    return 0;
}

That gives the following output on gcc:

mvo at mvo-devel:~/projects/testColumnNumber$ g++ main.cpp
main.cpp:3:0: warning: "MVOTEST" redefined
 #define MVOTEST hi

main.cpp:2:0: note: this is the location of the previous definition
 #define MVOTEST hello

main.cpp: In function ‘int main(int, char**)’:
main.cpp:4:1: error: ‘fffffff’ was not declared in this scope
 fffffff
 ^~~~~~~

Note that g++ disagrees with itself about the number of the first column.

Compiling the same code on clang gives:

mvo at mvo-devel:~/projects/testColumnNumber$ clang main.cpp
main.cpp:3:9: warning: 'MVOTEST' macro redefined [-Wmacro-redefined]
#define MVOTEST hi
        ^
main.cpp:2:9: note: previous definition is here
#define MVOTEST hello
        ^
main.cpp:4:1: error: use of undeclared identifier 'fffffff'
fffffff
^

Note that clang does not disagree with itself about the number of the first
column, and also (IMHO) points a little more accurate to where the problem
actually is.

That being said, I agree with Milian that it should be fairly easy to work
around this and give the user a better experience.

-- 
Regards / Med venlig hilsen

Morten Danielsen Volden
Software Developer
M.Sc. EE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20170128/9951ff4c/attachment.html>


More information about the KDevelop-devel mailing list