DoUML / douml

DoUML project: fork of BoUML 4.22
74 stars 35 forks source link

[OBS] Program returns random data in a function #154

Closed gilbertoca closed 8 years ago

gilbertoca commented 8 years ago

Hi, I'm trying to build DoUML int openSUSE Build Service. But build failed with :

[ 1702s] I: Program returns random data in a function
[ 1702s] E: douml no-return-in-nonvoid-function ../../bin/moc_release/java_catalog/../../../src/JavaCat/BrowserNode.h:71
[ 1702s] E: douml no-return-in-nonvoid-function ../JavaCat/BrowserNode.h:71
[ 1702s] E: douml no-return-in-nonvoid-function BrowserNode.h:71
[ 1702s] E: douml no-return-in-nonvoid-function hhbox.cpp:24
[ 1702s] E: douml no-return-in-nonvoid-function vvbox.cpp:21

And shows some warnings as well:

[ 1702s] I: Program is likely to break with new gcc. Try -fno-strict-aliasing.
[ 1702s] W: douml strict-aliasing-punning ../Tools/UmlBaseParameterSet.cpp:46
[ 1702s] W: douml strict-aliasing-punning UmlBaseParameterSet.cpp:46, 47
[ 1702s] W: douml strict-aliasing-punning diagram/CdClassCanvas.cpp:1564

Can someone help?

pasgui commented 8 years ago

On ubuntu 14.04, it is a warning only. gcc compiler version is 4.8. BrowserNode.h: In member function 'virtual QVariant BrowserNode::data(int, int) const': BrowserNode.h:71:55: warning: no return statement in function returning non-void [-Wreturn-type] virtual QVariant data(int column, int role) const{}; It seems openSUSE doesn't build packages with such errors (http://www.freecadweb.org/tracker/view.php?id=2212&history=1).

gilbertoca commented 8 years ago

Shouldn't this(code duplication) one be a good candidate to refactoring?

gilberto.andrade@BEM-INF007:~/tmp/douml> find -iname hhbox.cpp
./genplugouts/sm/hhbox.cpp
./genplugouts/uml_projection/hhbox.cpp
./genplugouts/xmi/hhbox.cpp
./genplugouts/CppUtilities/hhbox.cpp
./genplugouts/gpro/hhbox.cpp
./genplugouts/Xmi2Generator/hhbox.cpp
./genplugouts/GlobalChange/hhbox.cpp
./genplugouts/FileControl/hhbox.cpp
./src/ui/hhbox.cpp
gilberto.andrade@BEM-INF007:~/tmp/douml> diff ./genplugouts/sm/hhbox.cpp ./genplugouts/uml_projection/hhbox.cpp
gilberto.andrade@BEM-INF007:~/tmp/douml> diff ./genplugouts/sm/hhbox.cpp ./genplugouts/xmi/hhbox.cpp
gilberto.andrade@BEM-INF007:~/tmp/douml> diff ./genplugouts/sm/hhbox.cpp ./genplugouts/CppUtilities/hhbox.cpp
gilberto.andrade@BEM-INF007:~/tmp/douml> diff ./genplugouts/sm/hhbox.cpp ./genplugouts/gpro/hhbox.cpp
gilberto.andrade@BEM-INF007:~/tmp/douml> diff ./genplugouts/sm/hhbox.cpp ./genplugouts/Xmi2Generator/hhbox.cpp
gilberto.andrade@BEM-INF007:~/tmp/douml> diff ./genplugouts/sm/hhbox.cpp ./genplugouts/GlobalChange/hhbox.cpp
gilberto.andrade@BEM-INF007:~/tmp/douml> diff ./genplugouts/sm/hhbox.cpp ./genplugouts/FileControl/hhbox.cpp
gilberto.andrade@BEM-INF007:~/tmp/douml> diff ./genplugouts/sm/hhbox.cpp ./src/ui/hhbox.cpp
23a24
>     return 0;
gilberto.andrade@BEM-INF007:~/tmp/douml>
mobius3 commented 8 years ago

The whole genplugouts architecture needs a good refactoring, there is a lot of code duplication. I'd suggest opening another issue for this specific problem.

gilbertoca commented 8 years ago

None of the functions have a default: value or return something. So, for this one I think it should be simply a void function.

mobius3 commented 8 years ago

Those aren't a problem, its an easy fix. I was talking about creating an issue for plugout structure refactoring. I'm building DoUML to check if there's anywhere else with this problem before pushing a commit.