Community
Participate
Working Groups
xlc gives an error if there are several declarations of the same function "src/com/lowes/ss/sos/reqProject/reqProjectB.c", line 403.12: 1506-343 (S) Redeclaration of checkForAssocProj differs from previous declaration on line 306 of "src/com/lowes/ss/sos/reqProject/reqProject.h". I propose to generate opposite error message for second location "src/com/lowes/ss/sos/reqProject/reqProject.h", line 306: 1506-343 (S) Redeclaration of checkForAssocProj differs from another declaration on line 403 of "src/com/lowes/ss/sos/reqProject/reqProjectB.c" There is similar task for macros bug 321160
The fix committed to the HEAD (8.0)
*** cdt cvs genie on behalf of agvozdev *** bug 323445: Generate cross linked message for redeclaration xlc error [*] plugin.properties 1.9 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/xlc/org.eclipse.cdt.errorparsers.xlc/plugin.properties?root=Tools_Project&r1=1.8&r2=1.9 [*] plugin.xml 1.6 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/xlc/org.eclipse.cdt.errorparsers.xlc/plugin.xml?root=Tools_Project&r1=1.5&r2=1.6 [+] TestRedeclaration.java http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestRedeclaration.java?root=Tools_Project&revision=1.1&view=markup [*] AllXlcErrorParserTests.java 1.4 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/AllXlcErrorParserTests.java?root=Tools_Project&r1=1.3&r2=1.4
Olexiy, please verify if it is working OK. I am marking the first declaration with "Info" marker because it is not an error yet. It is an error to declare second time.
I think both messages has to be in the same Error group. In that case user will be able to see both messages together in Problem view and see error icon on file with different definition. This feature has to bring attention of programmer to particular files those have errors. I also propose to ignore meanless xlc info that is generated next to error message "src/com/lowes/ss/sos/reqProject/reqProjectB.c", line 2541.5: 1506-376 (I) Redeclaration of checkForAssocProj has a different number of fixed parameters than the previous declaration.
Let me take another look.
(In reply to comment #4) > I think both messages has to be in the same Error group. > In that case user will be able to see both messages together in Problem view and > see error icon on file with different definition. > This feature has to bring attention of programmer to particular files those have > errors. Okay, I suppose it would be more useful this way. > I also propose to ignore meanless xlc info that is generated next to error > message > "src/com/lowes/ss/sos/reqProject/reqProjectB.c", line 2541.5: 1506-376 (I) > Redeclaration of checkForAssocProj has a different number of fixed parameters > than the previous declaration. It's a daunting task to hunt after all possible warnings, I don't think it is feasible. I don't know how many others are out there. Consider: "test.c", line 4.6: 1506-302 (I) The declarations of the function fun must be consistent in their use of the ellipsis. "test.c", line 4.6: 1506-377 (I) The type "int" of parameter 1 differs from the previous type "int*". Besides, from practical point of view, it happens that the presence of the Info marker lets you navigate between both files in the Console view using "Next Error" buttons. Otherwise the "Redeclaration" line is associated with the error in one file only (the first marker).
*** cdt cvs genie on behalf of agvozdev *** bug 323445: Generate cross linked message for redeclaration xlc error [*] plugin.xml 1.7 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/xlc/org.eclipse.cdt.errorparsers.xlc/plugin.xml?root=Tools_Project&r1=1.6&r2=1.7 [*] TestRedeclaration.java 1.2 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestRedeclaration.java?root=Tools_Project&r1=1.1&r2=1.2